@date-io/dayjs
Advanced tools
Comparing version 1.1.0 to 1.2.0
import defaultDayjs from "dayjs"; | ||
import { IUtils } from "@date-io/core/IUtils"; | ||
interface Opts { | ||
/** Locale string, only for consistency and rerendering */ | ||
locale?: string; | ||
/** Make sure that your dayjs instance extends customParseFormat and advancedFormat */ | ||
instance?: typeof defaultDayjs; | ||
/** @deprecated */ | ||
dayjs?: typeof defaultDayjs; | ||
@@ -18,3 +22,3 @@ } | ||
dateFormat: string; | ||
constructor({ locale, dayjs }?: Opts); | ||
constructor({ locale, instance, dayjs }?: Opts); | ||
parse(value: any, format: any): defaultDayjs.Dayjs; | ||
@@ -21,0 +25,0 @@ date(value?: any): defaultDayjs.Dayjs; |
@@ -9,3 +9,3 @@ import defaultDayjs from 'dayjs'; | ||
function DayjsUtils(_a) { | ||
var _b = _a === void 0 ? {} : _a, locale = _b.locale, dayjs = _b.dayjs; | ||
var _b = _a === void 0 ? {} : _a, locale = _b.locale, instance = _b.instance, dayjs = _b.dayjs; | ||
this.yearFormat = "YYYY"; | ||
@@ -18,3 +18,3 @@ this.yearMonthFormat = "MMMM YYYY"; | ||
this.dateFormat = "MMMM Do"; | ||
this.dayjs = dayjs || defaultDayjs; | ||
this.dayjs = instance || dayjs || defaultDayjs; | ||
this.locale = locale; | ||
@@ -21,0 +21,0 @@ } |
@@ -13,3 +13,3 @@ 'use strict'; | ||
function DayjsUtils(_a) { | ||
var _b = _a === void 0 ? {} : _a, locale = _b.locale, dayjs = _b.dayjs; | ||
var _b = _a === void 0 ? {} : _a, locale = _b.locale, instance = _b.instance, dayjs = _b.dayjs; | ||
this.yearFormat = "YYYY"; | ||
@@ -22,3 +22,3 @@ this.yearMonthFormat = "MMMM YYYY"; | ||
this.dateFormat = "MMMM Do"; | ||
this.dayjs = dayjs || defaultDayjs; | ||
this.dayjs = instance || dayjs || defaultDayjs; | ||
this.locale = locale; | ||
@@ -25,0 +25,0 @@ } |
{ | ||
"name": "@date-io/dayjs", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Abstraction over common javascript date management libraries", | ||
@@ -12,8 +12,8 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@date-io/core": "^1.1.0" | ||
"@date-io/core": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"dayjs": "^1.8.0", | ||
"dayjs": "^1.8.12", | ||
"rollup": "^0.66.6", | ||
"typescript": "^3.2.4" | ||
"typescript": "^3.4.4" | ||
}, | ||
@@ -45,3 +45,3 @@ "scripts": { | ||
"license": "MIT", | ||
"gitHead": "75f08408e702874235295cf283747ed5c02193f0" | ||
"gitHead": "dc8ace95621e7f1a14024dbfd5b9d42fa18f4e88" | ||
} |
@@ -10,3 +10,7 @@ import defaultDayjs from "dayjs"; | ||
interface Opts { | ||
/** Locale string, only for consistency and rerendering */ | ||
locale?: string; | ||
/** Make sure that your dayjs instance extends customParseFormat and advancedFormat */ | ||
instance?: typeof defaultDayjs; | ||
/** @deprecated */ | ||
dayjs?: typeof defaultDayjs; | ||
@@ -36,4 +40,4 @@ } | ||
constructor({ locale, dayjs }: Opts = {}) { | ||
this.dayjs = dayjs || defaultDayjs; | ||
constructor({ locale, instance, dayjs }: Opts = {}) { | ||
this.dayjs = instance || dayjs || defaultDayjs; | ||
this.locale = locale; | ||
@@ -40,0 +44,0 @@ } |
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
27705
10
738
Updated@date-io/core@^1.2.0