@bbn/bbn 2.0.153 → 2.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/dt/classes/dt.d.ts +1 -1
- package/dist/dt/classes/dt.js +1 -1
- package/package.json +1 -1
package/dist/dt/classes/dt.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ export declare abstract class bbnDt<TValue extends bbnDtTemporal> {
|
|
|
112
112
|
diff(date: any, unit?: string, abs?: boolean): number;
|
|
113
113
|
guessUnit(valueInMs: number): string | null;
|
|
114
114
|
fromNow(unit?: string): string;
|
|
115
|
-
|
|
115
|
+
from(date: bbnDt<any>, unit?: string): string;
|
|
116
116
|
startOf(unit?: string): bbnDt<any>;
|
|
117
117
|
endOf(unit?: string): bbnDt<any>;
|
|
118
118
|
clone(): bbnDt<any>;
|
package/dist/dt/classes/dt.js
CHANGED
|
@@ -966,7 +966,7 @@ export class bbnDt {
|
|
|
966
966
|
const [, rtfUnit] = match; // [shortUnit, rtfUnit, ms]
|
|
967
967
|
return rtf.format(diff, rtfUnit);
|
|
968
968
|
}
|
|
969
|
-
|
|
969
|
+
from(date, unit = '') {
|
|
970
970
|
const rawDiffMs = this.diff(date);
|
|
971
971
|
const chosenUnit = unitsCorrespondence[unit] || this.guessUnit(rawDiffMs);
|
|
972
972
|
if (!chosenUnit) {
|