cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
LarsDP
Level 8

A very annoying dateformat bug

When I put the text 

Text(Date(Year(Now());Month(Now()); 1); "mmmm yyyy");

I get a perfectly working string "november 2016" as I want.

 

However, when I click anywhere in my project, i.e. switch the focus of the function ribbon to anything else, my function automatically gets updated to

Text(Date(Year(Now());Month(Now()); 1); "[$-nl-BE]mmmm yyyy");

with the text (translated from Dutch): "The language code nl-BE is not supported" and my formerly working string doesn't work anymore. I get an error with a blank text.

 

Is there an option to toggle the automatic appendation of the language code, seeing as this is sabotaging my work


EDIT: here is the bug in action

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: A very annoying dateformat bug

Hi Lars, I reproduced your error with nl-BE.  But I was able to edit manually the nl-BE to nl-NL and it gave me no error.

To see the list of supported languages, you can use this suggestion:

"To see the list of supported language tags, type Value( "1", ) in the formula bar or advanced view and scroll through the list of locales suggested for the second argument."

This comes from here: https://powerapps.microsoft.com/en-us/tutorials/function-language/

 

However on my system it still showed the name of the month in English:

 

Capture3.JPG

View solution in original post

5 REPLIES 5
Meneghino
Level 10

Re: A very annoying dateformat bug

Hi Lars, I reproduced your error with nl-BE.  But I was able to edit manually the nl-BE to nl-NL and it gave me no error.

To see the list of supported languages, you can use this suggestion:

"To see the list of supported language tags, type Value( "1", ) in the formula bar or advanced view and scroll through the list of locales suggested for the second argument."

This comes from here: https://powerapps.microsoft.com/en-us/tutorials/function-language/

 

However on my system it still showed the name of the month in English:

 

Capture3.JPG

View solution in original post

LarsDP
Level 8

Re: A very annoying dateformat bug

Thank you very much. Changing my region from BE to NL solved this issue. Somewhat strange that the auto-appended language code  that caused an error can't be turned off, but knowing the solution steers me more in the direction to tamper some more before 'ranting'. Thank you once again!

Power Apps Staff AndyPennell
Power Apps Staff

Re: A very annoying dateformat bug

To get the month in Dutch, add "nl-NL" as an argument e.g.

Text(Now(), "mmmm yyyy", "nl-NL")

 

The [$-nl-nl] syntax is to parse the format string, which doesnt change things for dates, only numbers. To change the output locale, add an argument as shown.

Meneghino
Level 10

Re: A very annoying dateformat bug

Thanks @AndyPennell

I noticed this additional locale parameter a couple of days ago, and have been using it heavily since then.  It is very useful also for parsing text inputted dates in a chosen locale for the app, without worrying about the user's locale.

Thanks for continuously improving PowerApps, I can get it to do almost anything I want now when working with cloud databases.

Panoone
Level: Powered On

Re: A very annoying dateformat bug

When I use the locale parameter my function is re-written.

 

Text(BaseSalary * 1.095, "$#,###","en-GB")

becomes

Text(BaseSalary * 1.095, "[$-en-GB]$#,###")

In addition, when I use en-GB I get a dollar sign. And when I use en-US I get a pound sign! Smiley LOL

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,642)