New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding national calendar support to 'debug messages' #978 #980
base: master
Are you sure you want to change the base?
Conversation
{id:"menu-item-calendars-default",toggle:"calendar-type",label:RED._("menu.label.view.defaultCalendar"),selected: true, onselect:function(s) { if(s){RED.text.bidi.setCalendarType("gregorian")}}}, | ||
{id:"menu-item-calendars-hijri",toggle:"calendar-type",label:RED._("menu.label.view.hijri"), onselect:function(s) { if(s){RED.text.bidi.setCalendarType("hijri")}}}, | ||
{id:"menu-item-calendars-hebrew",toggle:"calendar-type",label:RED._("menu.label.view.hebrew"), onselect:function(s) { if(s){RED.text.bidi.setCalendarType("hebrew")}}} | ||
]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to infer the user's preference based on other things? We don't want to fill the menu with options like this. Same question goes for the text direction options @wajnberg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user should be able to select his preferred calendar type -as in Windows. Many users in the Arabic countries may prefer to get the dates in Gregorian even if the App was translated into Arabic, this is common case and can't be ignored.
The national calendar doesn't depend on the language nor the GUI direction so it can't be inferred.
options = lang + "-u-ca-islamic"; | ||
else if(RED.text.bidi.getCalendarType() === "hebrew") | ||
options = lang + "-u-ca-hebrew"; | ||
return d.toLocaleString(options); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're likely to have other places that need to format a Date object properly, this code should be a utility function in bidi.js
node-red-gitbot: please udpate cla status |
Note: not merging this until we have more progress on #983. We want to ensure a consistent approach taken with all of the globalisation work, such as how the user configures it and what utility functions are provided in the code. |
I am sure @Ashamandi and @samarsultan will handle this. |
Adding national calendar support to 'debug messages' #978