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
Have an application which wants to use different relativeTimeThreshold values in different parts of its application
Call relativeTimeThreshold in one part of the application
Desired: There is a way to confine those relative time thresholds to that part of the application Observed: The changes are global
Proposal
Change the signature of humanize as follows:
exportfunctionhumanize(withSuffixOrOptions?: boolean|Options): string;exportinterfaceOptions{withSuffix?: boolean;thresholds?: Thresholds;}// Define a type with the current set of keys accepted by relativeTimeThresholdexporttypeThresholds=typeofthresholds;
Within humanize, if withSuffixOrOptions is an object and it contains a thresholds property, that will be used instead of the var thresholds defined earlier in the file.
The text was updated successfully, but these errors were encountered:
TedDriggs
added a commit
to TedDriggs/moment
that referenced
this issue
Nov 8, 2017
This issue describes a scoped means of invoking existing formatting behavior. I’d suggest filing a separate issue for a new formatting behavior that spans multiple units of time.
Note: PR #4296 has been submitted for this.
Description of the Issue and Steps to Reproduce:
relativeTimeThreshold
values in different parts of its applicationrelativeTimeThreshold
in one part of the applicationDesired: There is a way to confine those relative time thresholds to that part of the application
Observed: The changes are global
Proposal
Change the signature of
humanize
as follows:Within
humanize
, ifwithSuffixOrOptions
is an object and it contains athresholds
property, that will be used instead of thevar thresholds
defined earlier in the file.The text was updated successfully, but these errors were encountered: