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
I really like small and focused libraries like this one!
I tried to add Hungarian but the words for the time units ("year", "month", etc.) need to be different depending on whether the date is in the past or the future. Looks like disTime doesn't support that yet.
I don't know what your goals are with this library but if you want to support as many languages as possible, I would suggest making each language a function instead of a config object, like this:
And weird languages like Hungarian, Russian and Ukrainian could use their own custom implementation (this would also remove the need for the mode key in the config object).
What do you think? If you like this solution I can put up a PR with the necessary changes.
The text was updated successfully, but these errors were encountered:
I really like small and focused libraries like this one!
I tried to add Hungarian but the words for the time units ("year", "month", etc.) need to be different depending on whether the date is in the past or the future. Looks like disTime doesn't support that yet.
I don't know what your goals are with this library but if you want to support as many languages as possible, I would suggest making each language a function instead of a config object, like this:
A couple of examples to show how I think this could work:
majorValue
majorUnit
minorValue
minorUnit
isFuture
4
'year'
3
'month'
false
4
'year'
undefined
undefined
false
4
'year'
undefined
undefined
true
4
'year'
3
'month'
true
There could be a default implementation for the majority of languages which could accept a config object similar to the one currently used:
And weird languages like Hungarian, Russian and Ukrainian could use their own custom implementation (this would also remove the need for the
mode
key in the config object).What do you think? If you like this solution I can put up a PR with the necessary changes.
The text was updated successfully, but these errors were encountered: