milliseconds: number;
}
- interface HumanizeOptions {
- withSuffix?: boolean;
- thresholds?: {
- ss?: number;
- s?: number;
- m?: number;
- h?: number;
- d?: number;
- w?: number | void;
- M?: number;
- };
+ interface argThresholdOpts {
+ ss?: number;
+ s?: number;
+ m?: number;
+ h?: number;
+ d?: number;
+ w?: number | void;
+ M?: number;
}
interface Duration {
clone(): Duration;
- humanize(withSuffixOrOptions?: boolean | HumanizeOptions): string;
+ humanize(argWithSuffix?: boolean, argThresholds?: argThresholdOpts): string;
+
+ humanize(argThresholds?: argThresholdOpts): string;
abs(): Duration;
moment.localeData('en');
var globalLang = moment();
var localLang = moment();
+var thresholds = {
+ ss: 44,
+ s: 45,
+ m: 45,
+ h: 22,
+ d: 26,
+ w: 2,
+ M: 11,
+};
localLang.localeData();
localLang.format('LLLL');
globalLang.format('LLLL');
});
moment.duration(1, "minute").clone();
moment.duration(1, "minutes").humanize();
+moment.duration(1, "minutes").humanize(true);
+moment.duration(1, "minutes").humanize(thresholds);
+moment.duration(1, "minutes").humanize(true, thresholds);
moment.duration(500).milliseconds();
moment.duration(500).asMilliseconds();
moment.duration(500).seconds();
seconds: number;
milliseconds: number;
}
+ interface argThresholdOpts {
+ ss?: number;
+ s?: number;
+ m?: number;
+ h?: number;
+ d?: number;
+ w?: number | null;
+ M?: number;
+ }
interface Duration {
clone(): Duration;
- humanize(withSuffix?: boolean): string;
+ humanize(argWithSuffix?: boolean, argThresholds?: argThresholdOpts): string;
+
+ humanize(argThresholds?: argThresholdOpts): string;
abs(): Duration;
moment.localeData('en');
var globalLang = moment();
var localLang = moment();
+var thresholds = {
+ ss: 44,
+ s: 45,
+ m: 45,
+ h: 22,
+ d: 26,
+ w: 2,
+ M: 11,
+};
localLang.localeData();
localLang.format('LLLL');
globalLang.format('LLLL');
});
moment.duration(1, "minute").clone();
moment.duration(1, "minutes").humanize();
+moment.duration(1, "minutes").humanize(true);
+moment.duration(1, "minutes").humanize(thresholds);
+moment.duration(1, "minutes").humanize(true, thresholds);
moment.duration(500).milliseconds();
moment.duration(500).asMilliseconds();
moment.duration(500).seconds();