Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@naturalcycles/time-lib

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@naturalcycles/time-lib - npm Package Compare versions

Comparing version 1.4.3 to 1.5.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [1.5.0](https://github.com/NaturalCycles/time-lib/compare/v1.4.3...v1.5.0) (2019-08-21)
### Features
* dayjs().today() as alias to .startOf('day') ([b091ccc](https://github.com/NaturalCycles/time-lib/commit/b091ccc))
## [1.4.3](https://github.com/NaturalCycles/time-lib/compare/v1.4.2...v1.4.3) (2019-08-09)

@@ -2,0 +9,0 @@

4

dist/plugin/default.d.ts

@@ -20,2 +20,6 @@ import { PluginFunc } from 'dayjs';

unixMillis(): number;
/**
* Shortcut for .startOf('day')
*/
today(): Dayjs;
}

@@ -22,0 +26,0 @@ }

@@ -20,3 +20,6 @@ "use strict";

};
dayjsClass.prototype.today = function () {
return this.startOf('day');
};
};
//# sourceMappingURL=default.js.map

4

package.json

@@ -10,3 +10,2 @@ {

"@naturalcycles/js-lib": "^8.2.1",
"@naturalcycles/semantic-release": "^1.0.0",
"@naturalcycles/test-lib": "^1.0.0",

@@ -27,2 +26,3 @@ "@types/node": "^12.0.2",

"types": "dist/index.d.ts",
"sideEffects": false,
"publishConfig": {

@@ -38,3 +38,3 @@ "access": "public"

},
"version": "1.4.3",
"version": "1.5.0",
"description": "Date/time related API, based on DayJS",

@@ -41,0 +41,0 @@ "keywords": [

@@ -26,2 +26,7 @@ import { Dayjs, PluginFunc } from 'dayjs'

/**
* Shortcut for .startOf('day')
*/
today (): Dayjs
/**
* Forbid the method in favor of .toISODate()

@@ -44,17 +49,21 @@ */

export const defaultPlugins: PluginFunc = (_opt, dayjsClass, _dayjsFactory) => {
dayjsClass.prototype.toISODate = function (this: Dayjs) {
dayjsClass.prototype.toISODate = function (this: Dayjs): string {
return this.format(DAYJS_ISO_DATE)
}
dayjsClass.prototype.toPretty = function (this: Dayjs) {
dayjsClass.prototype.toPretty = function (this: Dayjs): string {
return this.format(DAYJS_PRETTY_TIME)
}
dayjsClass.prototype.toCompactTime = function (this: Dayjs, seconds = false) {
dayjsClass.prototype.toCompactTime = function (this: Dayjs, seconds = false): string {
return this.format(seconds ? DAYJS_COMPACT_TIME_SECONDS : DAYJS_COMPACT_TIME)
}
dayjsClass.prototype.unixMillis = function (this: Dayjs) {
dayjsClass.prototype.unixMillis = function (this: Dayjs): number {
return this.valueOf()
}
dayjsClass.prototype.today = function (this: Dayjs): Dayjs {
return this.startOf('day')
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc