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
Describe the bug
As per this documentation, dayjs support additional token processing with the same API as moment js. It will throw an error if I pass past and future a function for additional processing.
For the rest of the relativeTime keys, it works perfectly.
Example of error:
dayjs.updateLocale("en",{relativeTime: {future: "in %s",past: (input)=>{return"additional processing";},s: "just now",m: " 1 min",mm: "%d min",h: "1 hr",hh: "%d hrs",d: "a day",dd: "%d days",M: "a month",MM: "%d months",y: "a year",yy: "%d years"}});
Expected behavior relativeTime.future and relativeTime.past should support function for additional processing
Information
Day.js Version 1.9.4, 1.9.5
OS: macOS
Browser Version 86.0.4240.183
Time zone: GMT+7
The text was updated successfully, but these errors were encountered:
drgx
changed the title
RelativeTimes "past" and "future" does not support function
RelativeTimes "past" and "future" keys does not support function
Nov 9, 2020
drgx
changed the title
RelativeTimes "past" and "future" keys does not support function
RelativeTime ".past" and ".future" keys does not support function
Nov 9, 2020
Describe the bug
As per this documentation, dayjs support additional token processing with the same API as moment js. It will throw an error if I pass
past
andfuture
a function for additional processing.For the rest of the
relativeTime
keys, it works perfectly.Example of error:
Can be tested here: https://codesandbox.io/s/dayjs-relativestime-bug-1k2m9?file=/src/index.js
Expected behavior
relativeTime.future
andrelativeTime.past
should support function for additional processingInformation
The text was updated successfully, but these errors were encountered: