You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically I am wondering if there is a non-hacky way in d3 time format to show localized pair of Hours:Minutes (to get 18:03 in German locale and 6:03 PM in US locale)
As I see, moment.js has something like
longDateFormat : {LT : 'HH:mm',// <----- this is what I can not find in D3.jsLTS : 'HH:mm:ss',L : 'DD/MM/YYYY',LL : 'D MMMM YYYY',LLL : 'D MMMM YYYY HH:mm',LLLL : 'dddd D MMMM YYYY HH:mm'},
I do not suggest to mimic moment behavior, but time without seconds is pretty useful for time charts, where seconds may not be useful. This localized hh:mm pair can be easily used in the localized multiFormat function as formatHour
The text was updated successfully, but these errors were encountered:
It seems that every current locale is either %H:%M:%S or %-I:%M:%S %p, so you could just use %H:%M or %-I:%M %p as appropriate. If that feels like a hack, I think we’d have to introduce a new field, say timeMinutes to the locale definition to make the desired localized definition explicit.
Basically I am wondering if there is a non-hacky way in d3 time format to show localized pair of Hours:Minutes (to get 18:03 in German locale and 6:03 PM in US locale)
As I see, moment.js has something like
I do not suggest to mimic moment behavior, but time without seconds is pretty useful for time charts, where seconds may not be useful. This localized hh:mm pair can be easily used in the localized
multiFormat
function asformatHour
The text was updated successfully, but these errors were encountered: