-
Notifications
You must be signed in to change notification settings - Fork 222
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
en-GB and en-US locales now use 12 hour format #214
Conversation
Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.)
Just want to hold off on this one until the 12:00 display is sorted for consistency, hope that's ok :) |
Sorry, I did not get what you mean. Nevertheless I'm sure you are right. But I'm curious. |
Sorry for the delay on getting an answer to what I mean! So the issue with using Can you please add this in? Take a look at the date-fns locales for an example of how they encode the values |
I'm sorry but I don't get your point. Can you give me an example of what doesn't work? date-fns locales have this:
Is that |
Exactly - at the moment, At the moment, that doesn't include Does that make sense? |
Oh I see your point now. Sorry it took me a while. I'll try something during the weekend. Sorry about the repeated request for clarification. |
No worries 😄 should be a quick one I hope, as I think you'll be able to reuse the functions in |
Ah also - when you've put a solution in place, please ping the various locale creators so they know to update their translations with the correct am-pm values (or steal them from |
@edcarroll Do you what to have all the alternatives that
|
@harogaston let's go for all three, I feel clarity is better here |
- timesOfDay - timesOfDayUppercase - timesOfDayLowercase to support proper formatting/parsing of dates in datepicker. Updated Localization page
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.
Awesome! Couple of final things before we get this merged (v small things tho)
@@ -4,8 +4,8 @@ const enUS:IPartialLocaleValues = { | |||
datepicker: { | |||
firstDayOfWeek: 0, | |||
formats: { | |||
time: "HH:mm", | |||
datetime: "MMMM D, YYYY HH:mm", | |||
time: "hh:mm aa", |
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.
Does this invalidate the need for the other PR?
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.
Wait I'm an idiot ignore me
function buildLocalizeFn(values:IDateFnsLocaleValues, defaultType:string):DateFnsHelper<number, string> { | ||
return (dirtyIndex, { type } = { type: defaultType }) => values[type][dirtyIndex]; | ||
function buildLocalizeFn(values:IDateFnsLocaleValues, defaultType:string, | ||
indexCallback?:(oldIndex:number) => number):DateFnsHelper<number, string> { |
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.
Could you put each arg on its own line please? Leave a space before the 1st statement in the function also when breaking like this
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.
Working on it
Final thing regarding all of your commits, please make sure you are following the commit message style in the contribution guidelines - i.e. |
For better results it should be tested against feat(datepicker) Popup now honors locale and pickerLocaleOverrides but it works independently as well. For now only two values for |
@harogaston have just merged that PR, do you want to pull master into this branch and do a quick test? No worries re only 2 values - does |
Sorry about that. I also have a few other similar questions. I'll talk to you via gitter later. |
Don't forgot to mark the review comments as done to close them 😄 |
I have tested it including those changes already.
Yes they allow things like:
But for that to work locales will have to provide their own parsing functions. |
I don't know how to... |
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.
Hmm thought there was a button but may be mistaken. Oh well! Happy to approve this 🎉
Ahh ok let's leave the further customisation as a future feature 😄 |
* fix: Fixed AOT on SystemJS builder Closes #209 * fix: Added custom FocusEvent interface (#231) * fix: Added custom FocusEvent interface Closes #202 FocusEvent isn't defined in UC browser, so added IFocusEvent with the property we need. * style(util): Fixed tslint error * chore(popup): Relaxed popper.js dependency (#228) Follows up on #195 * fix(popup): Fixed delay causing destroyed view errors (#233) Closes #189 * fix(select): Manually run change detector when option updates (#236) * fix(select): Manually run change detector when option updates Closes #213 * style(select): Fixed tslint error * fix(select): Selected options now updated when options change (#232) * fix(modal): Fixed aggressive autofocus sometimes causing errors (#237) * fix(popup): Fixed conflict with BrowserAnimationsModule (#234) * fix(popup): Fixed conflict with BrowserAnimationsModule Closes #204 * style(popup): Fixed tslint error * feat(popup): Added template context support (#238) * fix(popup): Fixed focus events on popup (#243) * feat(datepicker) Popup now honors locale and pickerLocaleOverrides (#215) * Datepicker popup now honors locale and pickerLocaleOverrides - Datepicker popup items now respect locale format - Fixed a bug in zoom calendar mapping for datetime datepicker - Fixed 'es' locale for consistency (*) Partially addresses #164 * Added comments. * Time of day values supported in locale definitions (#214) * en-GB and en-US locales now use 12 hour format Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.) * Fix locales Russian, Italian and Hebrew now extend from ILocaleValues. * Added new IDatepickerFormatsLocaleValues fields: - timesOfDay - timesOfDayUppercase - timesOfDayLowercase to support proper formatting/parsing of dates in datepicker. Updated Localization page * Fixing code formatting * feat(datepicker) Added initial date support for the datepicker (#216) * feat(datepicker) New input pickerInitialDate - New input (optional) that sets the intial date to display (null = today) - Updated demo page Partially addresses #165 * Now pickerInitialDate only sets CalendarService.currentDate property * feat(datepicker): Initial date support - Code formatting * fix: Various minor bugfixes (#245) * fix(select): Fixed destroyed view errors * fix(modal): Fix modal auto closing when clicked * fix(popup): Removed console log in focus handler * fix(popup): Forced import of TemplateRef * fix: Fixed AOT on SystemJS builder Closes #209
* en-GB and en-US locales now use 12 hour format Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.) * Fix locales Russian, Italian and Hebrew now extend from ILocaleValues. * Added new IDatepickerFormatsLocaleValues fields: - timesOfDay - timesOfDayUppercase - timesOfDayLowercase to support proper formatting/parsing of dates in datepicker. Updated Localization page * Fixing code formatting
* fix: Fixed AOT on SystemJS builder Closes edcarroll#209 * fix: Added custom FocusEvent interface (edcarroll#231) * fix: Added custom FocusEvent interface Closes edcarroll#202 FocusEvent isn't defined in UC browser, so added IFocusEvent with the property we need. * style(util): Fixed tslint error * chore(popup): Relaxed popper.js dependency (edcarroll#228) Follows up on edcarroll#195 * fix(popup): Fixed delay causing destroyed view errors (edcarroll#233) Closes edcarroll#189 * fix(select): Manually run change detector when option updates (edcarroll#236) * fix(select): Manually run change detector when option updates Closes edcarroll#213 * style(select): Fixed tslint error * fix(select): Selected options now updated when options change (edcarroll#232) * fix(modal): Fixed aggressive autofocus sometimes causing errors (edcarroll#237) * fix(popup): Fixed conflict with BrowserAnimationsModule (edcarroll#234) * fix(popup): Fixed conflict with BrowserAnimationsModule Closes edcarroll#204 * style(popup): Fixed tslint error * feat(popup): Added template context support (edcarroll#238) * fix(popup): Fixed focus events on popup (edcarroll#243) * feat(datepicker) Popup now honors locale and pickerLocaleOverrides (edcarroll#215) * Datepicker popup now honors locale and pickerLocaleOverrides - Datepicker popup items now respect locale format - Fixed a bug in zoom calendar mapping for datetime datepicker - Fixed 'es' locale for consistency (*) Partially addresses edcarroll#164 * Added comments. * Time of day values supported in locale definitions (edcarroll#214) * en-GB and en-US locales now use 12 hour format Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.) * Fix locales Russian, Italian and Hebrew now extend from ILocaleValues. * Added new IDatepickerFormatsLocaleValues fields: - timesOfDay - timesOfDayUppercase - timesOfDayLowercase to support proper formatting/parsing of dates in datepicker. Updated Localization page * Fixing code formatting * feat(datepicker) Added initial date support for the datepicker (edcarroll#216) * feat(datepicker) New input pickerInitialDate - New input (optional) that sets the intial date to display (null = today) - Updated demo page Partially addresses edcarroll#165 * Now pickerInitialDate only sets CalendarService.currentDate property * feat(datepicker): Initial date support - Code formatting * fix: Various minor bugfixes (edcarroll#245) * fix(select): Fixed destroyed view errors * fix(modal): Fix modal auto closing when clicked * fix(popup): Removed console log in focus handler * fix(popup): Forced import of TemplateRef * fix: Fixed AOT on SystemJS builder Closes edcarroll#209
Original "HH:mm" (23:59) -> Now "hh:mm aa" (11:59 p.m.)
Before submitting a pull request, please make sure you have at least performed the following: