@naturalcycles/time-lib
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -0,1 +1,8 @@ | ||
# [1.1.0](https://github.com/NaturalCycles/time-lib/compare/v1.0.3...v1.1.0) (2019-05-20) | ||
### Features | ||
* days.toCompactTime(seconds?: boolean) ([941abaa](https://github.com/NaturalCycles/time-lib/commit/941abaa)) | ||
## [1.0.3](https://github.com/NaturalCycles/time-lib/compare/v1.0.2...v1.0.3) (2019-05-19) | ||
@@ -2,0 +9,0 @@ |
@@ -12,2 +12,6 @@ import { PluginFunc } from 'dayjs'; | ||
toPretty(): string; | ||
/** | ||
* Returns e.g `20180621_1754` or `20180621_175404` (with seconds). | ||
*/ | ||
toCompactTime(seconds?: boolean): string; | ||
} | ||
@@ -17,2 +21,4 @@ } | ||
export declare const DAYJS_PRETTY_TIME = "YYYY-MM-DD HH:mm:ss"; | ||
export declare const DAYJS_COMPACT_TIME = "YYYYMMDD_HHmm"; | ||
export declare const DAYJS_COMPACT_TIME_SECONDS = "YYYYMMDD_HHmmss"; | ||
export declare const dayjsPlugins: PluginFunc; |
@@ -5,2 +5,4 @@ "use strict"; | ||
exports.DAYJS_PRETTY_TIME = 'YYYY-MM-DD HH:mm:ss'; | ||
exports.DAYJS_COMPACT_TIME = 'YYYYMMDD_HHmm'; | ||
exports.DAYJS_COMPACT_TIME_SECONDS = 'YYYYMMDD_HHmmss'; | ||
exports.dayjsPlugins = (_opt, dayjsClass, _dayjsFactory) => { | ||
@@ -13,3 +15,6 @@ dayjsClass.prototype.toISODate = function () { | ||
}; | ||
dayjsClass.prototype.toCompactTime = function (seconds = false) { | ||
return this.format(seconds ? exports.DAYJS_COMPACT_TIME_SECONDS : exports.DAYJS_COMPACT_TIME); | ||
}; | ||
}; | ||
//# sourceMappingURL=dayjs.plugins.js.map |
@@ -34,3 +34,3 @@ { | ||
}, | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Date/time related API, based on DayJS", | ||
@@ -37,0 +37,0 @@ "keywords": [ |
@@ -14,2 +14,7 @@ import { Dayjs, PluginFunc } from 'dayjs' | ||
toPretty (): string | ||
/** | ||
* Returns e.g `20180621_1754` or `20180621_175404` (with seconds). | ||
*/ | ||
toCompactTime (seconds?: boolean): string | ||
} | ||
@@ -20,2 +25,4 @@ } | ||
export const DAYJS_PRETTY_TIME = 'YYYY-MM-DD HH:mm:ss' | ||
export const DAYJS_COMPACT_TIME = 'YYYYMMDD_HHmm' | ||
export const DAYJS_COMPACT_TIME_SECONDS = 'YYYYMMDD_HHmmss' | ||
@@ -30,2 +37,6 @@ export const dayjsPlugins: PluginFunc = (_opt, dayjsClass, _dayjsFactory) => { | ||
} | ||
dayjsClass.prototype.toCompactTime = function (this: Dayjs, seconds = false) { | ||
return this.format(seconds ? DAYJS_COMPACT_TIME_SECONDS : DAYJS_COMPACT_TIME) | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11120
206