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
Hello, is there a way to conditionally update relativeTime?
The current way we do it from docs is like this:
dayjs.extend(updateLocale)dayjs.updateLocale('en',{relativeTime: {future: "in %s",past: "%s ago",s: 'a few seconds',m: "a minute",mm: "%d minutes",h: "an hour",hh: "%d hours",d: "a day",dd: "%d days",M: "a month",MM: "%d months",y: "a year",yy: "%d years"}})
In my code, I want to keep this formats but also want to update it conditionally?
I have some code that I want to use this format
dayjs('2021-09-29').fromNow() // 1 day ago
and I also have some code that I want to update some if a condition is met somewhere
@mirabledictu did you ever find a way to do this? only way we can think of is setting the locale and then later changing the global locale of dayjs back to the original 😕
Hello, is there a way to conditionally update relativeTime?
The current way we do it from docs is like this:
In my code, I want to keep this formats but also want to update it conditionally?
I have some code that I want to use this format
and I also have some code that I want to update some if a condition is met somewhere
The text was updated successfully, but these errors were encountered: