@beinformed/ui 1.59.18 → 1.59.20
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/CHANGELOG.md +15 -0
- package/esm/models/attributes/AttributeModel.js +1 -2
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +1 -2
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +1 -2
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +1 -2
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +1 -2
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +1 -2
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js +1 -2
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/redux/reducers/ModelCatalogReducer.js +1 -2
- package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -1
- package/esm/redux/selectors/modelcatalog.js +1 -2
- package/esm/redux/selectors/modelcatalog.js.map +1 -1
- package/esm/utils/browser/Cache.js +2 -1
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js +16 -1
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +1 -2
- package/lib/models/attributes/AttributeModel.js.flow +4 -2
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +1 -2
- package/lib/models/attributes/BooleanAttributeModel.js.flow +4 -3
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +1 -2
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +4 -2
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +1 -2
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +1 -3
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +1 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +2 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +1 -2
- package/lib/models/lookup/LookupOptionCollection.js.flow +4 -2
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js +1 -2
- package/lib/models/process/ProcessStatusSettingsModel.js.flow +1 -2
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/redux/reducers/ModelCatalogReducer.js +1 -2
- package/lib/redux/reducers/ModelCatalogReducer.js.flow +1 -2
- package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -1
- package/lib/redux/selectors/modelcatalog.js +1 -2
- package/lib/redux/selectors/modelcatalog.js.flow +3 -3
- package/lib/redux/selectors/modelcatalog.js.map +1 -1
- package/lib/utils/browser/Cache.js +2 -1
- package/lib/utils/browser/Cache.js.flow +4 -1
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +52 -37
- package/lib/utils/datetime/DateTimeUtil.js.flow +17 -18
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/package.json +13 -13
- package/src/models/attributes/AttributeModel.js +4 -2
- package/src/models/attributes/BooleanAttributeModel.js +4 -3
- package/src/models/attributes/ChoiceAttributeModel.js +4 -2
- package/src/models/attributes/ChoiceAttributeOptionCollection.js +1 -3
- package/src/models/attributes/ChoiceAttributeOptionModel.js +2 -2
- package/src/models/lookup/LookupOptionCollection.js +4 -2
- package/src/models/process/ProcessStatusSettingsModel.js +1 -2
- package/src/redux/reducers/ModelCatalogReducer.js +1 -2
- package/src/redux/selectors/modelcatalog.js +3 -3
- package/src/utils/browser/Cache.js +4 -1
- package/src/utils/datetime/DateTimeUtil.js +17 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelCatalogReducer.js","names":["
|
|
1
|
+
{"version":3,"file":"ModelCatalogReducer.js","names":["_Cache","_interopRequireDefault","require","initialState","entryDate","Date","toISOString","split","ModelCatalogReducer","state","arguments","length","undefined","action","type","Cache","addItem","payload","_default","exports","default"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst initialState: ModelCatalogState = {\n entryDate: new Date().toISOString().split(\"T\")[0],\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,MAAMC,YAA+B,GAAG;EACtCC,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGP,YAAY;EAAA,IACpBU,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBC,cAAK,CAACC,OAAO,CAAC,uBAAuB,EAAEH,MAAM,CAACI,OAAO,CAAC;MACtD,OAAO;QACL,GAAGR,KAAK;QACRL,SAAS,EAAES,MAAM,CAACI;MACpB,CAAC;IACH;MACE,OAAOR,KAAK;EAChB;AACF,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaZ,mBAAmB","ignoreList":[]}
|
|
@@ -4,12 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getEntryDate = void 0;
|
|
7
|
-
var _utils = require("../../utils");
|
|
8
7
|
/**
|
|
9
8
|
* Retrieve entrydate for the model catalog
|
|
10
9
|
*/
|
|
11
10
|
const getEntryDate = state => {
|
|
12
|
-
return state.modelcatalog?.entryDate ??
|
|
11
|
+
return state.modelcatalog?.entryDate ?? new Date().toISOString().split("T")[0];
|
|
13
12
|
};
|
|
14
13
|
exports.getEntryDate = getEntryDate;
|
|
15
14
|
//# sourceMappingURL=modelcatalog.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import { DateUtil } from "../../utils";
|
|
3
|
-
|
|
4
2
|
import type { ReduxState } from "../types";
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* Retrieve entrydate for the model catalog
|
|
8
6
|
*/
|
|
9
7
|
export const getEntryDate = (state: ReduxState): ISO_DATE => {
|
|
10
|
-
return
|
|
8
|
+
return (
|
|
9
|
+
state.modelcatalog?.entryDate ?? new Date().toISOString().split("T")[0]
|
|
10
|
+
);
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelcatalog.js","names":["
|
|
1
|
+
{"version":3,"file":"modelcatalog.js","names":["getEntryDate","state","modelcatalog","entryDate","Date","toISOString","split","exports"],"sources":["../../../src/redux/selectors/modelcatalog.js"],"sourcesContent":["// @flow\nimport type { ReduxState } from \"../types\";\n\n/**\n * Retrieve entrydate for the model catalog\n */\nexport const getEntryDate = (state: ReduxState): ISO_DATE => {\n return (\n state.modelcatalog?.entryDate ?? new Date().toISOString().split(\"T\")[0]\n );\n};\n"],"mappings":";;;;;;AAGA;AACA;AACA;AACO,MAAMA,YAAY,GAAIC,KAAiB,IAAe;EAC3D,OACEA,KAAK,CAACC,YAAY,EAAEC,SAAS,IAAI,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE3E,CAAC;AAACC,OAAA,CAAAP,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-
|
|
|
9
9
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
10
10
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
11
11
|
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
12
|
+
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
|
|
12
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
13
14
|
const RESOURCE_CACHE_PREFIX = "res:";
|
|
14
15
|
|
|
@@ -135,7 +136,7 @@ class Cache {
|
|
|
135
136
|
const newData = e.newValue ? JSON.parse(e.newValue) : {};
|
|
136
137
|
(0, _filter.default)(_context2 = (0, _entries.default)(newData)).call(_context2, _ref => {
|
|
137
138
|
let [key] = _ref;
|
|
138
|
-
return !this.hasItem(key);
|
|
139
|
+
return !this.hasItem(key) && !(0, _startsWith.default)(key).call(key, RESOURCE_CACHE_PREFIX);
|
|
139
140
|
}).forEach(_ref2 => {
|
|
140
141
|
let [key, value] = _ref2;
|
|
141
142
|
this.addItem(key, value);
|
|
@@ -137,7 +137,10 @@ class Cache {
|
|
|
137
137
|
// receive sessionstorage from other tabs
|
|
138
138
|
const newData = e.newValue ? JSON.parse(e.newValue) : {};
|
|
139
139
|
Object.entries(newData)
|
|
140
|
-
.filter(
|
|
140
|
+
.filter(
|
|
141
|
+
([key]) =>
|
|
142
|
+
!this.hasItem(key) && !key.startsWith(RESOURCE_CACHE_PREFIX),
|
|
143
|
+
)
|
|
141
144
|
.forEach(([key, value]) => {
|
|
142
145
|
this.addItem(key, value);
|
|
143
146
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cache.js","names":["RESOURCE_CACHE_PREFIX","Cache","constructor","_defineProperty2","default","sessionStorage","_cache","createResourceKey","requestArgs","resourceKey","url","params","locale","getItem","key","cache","cacheItem","JSON","parse","error","hasItem","addItem","value","stringValue","_stringify","setItem","removeItem","clear","pattern","_context","_filter","_keys","call","k","RegExp","test","forEach","loadOtherBrowserTabs","callback","window","addEventListener","e","sendSessionStorage","receiveSessionStorage","length","localStorage","Date","now","toString","_context2","newData","newValue","_entries","_ref","_ref2","_default","exports"],"sources":["../../../src/utils/browser/Cache.js"],"sourcesContent":["// @flow\nimport type { RequestOptions } from \"../fetch/types\";\n\nconst RESOURCE_CACHE_PREFIX = \"res:\";\n\n/**\n * Manage the browser cache\n */\nclass Cache {\n _cache: Storage;\n\n /**\n */\n constructor() {\n if (typeof sessionStorage !== \"undefined\") {\n this._cache = sessionStorage;\n }\n }\n\n /**\n * Create a key that can be used to cache resources, needs the request arguments and uses url, params and header of the request args\n * to create a key that is unique for time versions and locale\n */\n createResourceKey(requestArgs: RequestOptions): string {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return `${RESOURCE_CACHE_PREFIX}${resourceKey}`;\n }\n\n /**\n * Get a cached item by it's key\n */\n getItem(key: string): any {\n const cache = this._cache;\n\n if (!cache) {\n return null;\n }\n\n const cacheItem = cache.getItem(key);\n\n if (!cacheItem) {\n return null;\n }\n\n try {\n return JSON.parse(cacheItem);\n } catch (error) {\n return this._cache.getItem(key);\n }\n }\n\n /**\n * Check if the item with key exists in the browser cache\n */\n hasItem(key: string): boolean {\n return this.getItem(key) !== null;\n }\n\n /**\n * Add an item to the cache\n */\n addItem(key: string, value: string | Object) {\n const stringValue =\n typeof value === \"string\" ? value : JSON.stringify(value);\n\n this._cache.setItem(key, stringValue);\n }\n\n /**\n */\n setItem(key: string, value: string | Object) {\n this.addItem(key, value);\n }\n\n /**\n */\n removeItem(key: string) {\n this._cache.removeItem(key);\n }\n\n /**\n * Clear complete cache storage\n */\n clear(pattern: ?string) {\n if (!this._cache) {\n return;\n }\n\n if (pattern) {\n Object.keys(this._cache)\n .filter((k) => (pattern ? new RegExp(pattern).test(k) : true))\n .forEach((k) => this._cache.removeItem(k));\n } else {\n this._cache.clear();\n }\n }\n\n // Session storage is not available between different tabs in the same window,\n // this load method copies sessionStorage from other tabs into this tab using localStorage\n // see https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/\n /**\n */\n loadOtherBrowserTabs(callback: Function) {\n window.addEventListener(\"storage\", (e) => {\n this.sendSessionStorage(e);\n this.receiveSessionStorage(e, callback);\n });\n\n if (this._cache.length === 0) {\n // trigger retrieval of sessionstorage on other tabs\n localStorage.setItem(\"getSessionStorage\", Date.now().toString());\n }\n }\n\n /**\n */\n sendSessionStorage(e: StorageEvent) {\n if (e.key === \"getSessionStorage\") {\n localStorage.setItem(\"sessionStorage\", JSON.stringify(this._cache));\n localStorage.removeItem(\"sessionStorage\");\n }\n }\n\n /**\n */\n receiveSessionStorage(e: StorageEvent, callback: Function): any {\n if (e.key === \"sessionStorage\" && !this.getItem(\"sessionStorageCopied\")) {\n // receive sessionstorage from other tabs\n const newData = e.newValue ? JSON.parse(e.newValue) : {};\n Object.entries(newData)\n .filter(([key])
|
|
1
|
+
{"version":3,"file":"Cache.js","names":["RESOURCE_CACHE_PREFIX","Cache","constructor","_defineProperty2","default","sessionStorage","_cache","createResourceKey","requestArgs","resourceKey","url","params","locale","getItem","key","cache","cacheItem","JSON","parse","error","hasItem","addItem","value","stringValue","_stringify","setItem","removeItem","clear","pattern","_context","_filter","_keys","call","k","RegExp","test","forEach","loadOtherBrowserTabs","callback","window","addEventListener","e","sendSessionStorage","receiveSessionStorage","length","localStorage","Date","now","toString","_context2","newData","newValue","_entries","_ref","_startsWith","_ref2","_default","exports"],"sources":["../../../src/utils/browser/Cache.js"],"sourcesContent":["// @flow\nimport type { RequestOptions } from \"../fetch/types\";\n\nconst RESOURCE_CACHE_PREFIX = \"res:\";\n\n/**\n * Manage the browser cache\n */\nclass Cache {\n _cache: Storage;\n\n /**\n */\n constructor() {\n if (typeof sessionStorage !== \"undefined\") {\n this._cache = sessionStorage;\n }\n }\n\n /**\n * Create a key that can be used to cache resources, needs the request arguments and uses url, params and header of the request args\n * to create a key that is unique for time versions and locale\n */\n createResourceKey(requestArgs: RequestOptions): string {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return `${RESOURCE_CACHE_PREFIX}${resourceKey}`;\n }\n\n /**\n * Get a cached item by it's key\n */\n getItem(key: string): any {\n const cache = this._cache;\n\n if (!cache) {\n return null;\n }\n\n const cacheItem = cache.getItem(key);\n\n if (!cacheItem) {\n return null;\n }\n\n try {\n return JSON.parse(cacheItem);\n } catch (error) {\n return this._cache.getItem(key);\n }\n }\n\n /**\n * Check if the item with key exists in the browser cache\n */\n hasItem(key: string): boolean {\n return this.getItem(key) !== null;\n }\n\n /**\n * Add an item to the cache\n */\n addItem(key: string, value: string | Object) {\n const stringValue =\n typeof value === \"string\" ? value : JSON.stringify(value);\n\n this._cache.setItem(key, stringValue);\n }\n\n /**\n */\n setItem(key: string, value: string | Object) {\n this.addItem(key, value);\n }\n\n /**\n */\n removeItem(key: string) {\n this._cache.removeItem(key);\n }\n\n /**\n * Clear complete cache storage\n */\n clear(pattern: ?string) {\n if (!this._cache) {\n return;\n }\n\n if (pattern) {\n Object.keys(this._cache)\n .filter((k) => (pattern ? new RegExp(pattern).test(k) : true))\n .forEach((k) => this._cache.removeItem(k));\n } else {\n this._cache.clear();\n }\n }\n\n // Session storage is not available between different tabs in the same window,\n // this load method copies sessionStorage from other tabs into this tab using localStorage\n // see https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/\n /**\n */\n loadOtherBrowserTabs(callback: Function) {\n window.addEventListener(\"storage\", (e) => {\n this.sendSessionStorage(e);\n this.receiveSessionStorage(e, callback);\n });\n\n if (this._cache.length === 0) {\n // trigger retrieval of sessionstorage on other tabs\n localStorage.setItem(\"getSessionStorage\", Date.now().toString());\n }\n }\n\n /**\n */\n sendSessionStorage(e: StorageEvent) {\n if (e.key === \"getSessionStorage\") {\n localStorage.setItem(\"sessionStorage\", JSON.stringify(this._cache));\n localStorage.removeItem(\"sessionStorage\");\n }\n }\n\n /**\n */\n receiveSessionStorage(e: StorageEvent, callback: Function): any {\n if (e.key === \"sessionStorage\" && !this.getItem(\"sessionStorageCopied\")) {\n // receive sessionstorage from other tabs\n const newData = e.newValue ? JSON.parse(e.newValue) : {};\n Object.entries(newData)\n .filter(\n ([key]) =>\n !this.hasItem(key) && !key.startsWith(RESOURCE_CACHE_PREFIX),\n )\n .forEach(([key, value]) => {\n this.addItem(key, value);\n });\n\n this.setItem(\"sessionStorageCopied\", Date.now().toString());\n\n return callback();\n }\n\n return null;\n }\n}\n\nexport default (new Cache(): Cache);\n"],"mappings":";;;;;;;;;;;;;AAGA,MAAMA,qBAAqB,GAAG,MAAM;;AAEpC;AACA;AACA;AACA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AO,CAAC,sBAAsB,EAAEqB,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAAC;MAE3D,OAAOV,QAAQ,CAAC,CAAC;IACnB;IAEA,OAAO,IAAI;EACb;AACF;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAEe,IAAIH,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,22 @@ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable
|
|
|
11
11
|
var _trunc = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/math/trunc"));
|
|
12
12
|
var _padStart = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/pad-start"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
14
|
-
var
|
|
14
|
+
var _format = require("date-fns/format");
|
|
15
|
+
var _isAfter = require("date-fns/isAfter");
|
|
16
|
+
var _isBefore = require("date-fns/isBefore");
|
|
17
|
+
var _isSameDay = require("date-fns/isSameDay");
|
|
18
|
+
var _isValid = require("date-fns/isValid");
|
|
19
|
+
var _parse = require("date-fns/parse");
|
|
20
|
+
var _add = require("date-fns/add");
|
|
21
|
+
var _sub = require("date-fns/sub");
|
|
22
|
+
var _set = require("date-fns/set");
|
|
23
|
+
var _startOfMonth = require("date-fns/startOfMonth");
|
|
24
|
+
var _endOfMonth = require("date-fns/endOfMonth");
|
|
25
|
+
var _startOfWeek = require("date-fns/startOfWeek");
|
|
26
|
+
var _getHours = require("date-fns/getHours");
|
|
27
|
+
var _getMinutes = require("date-fns/getMinutes");
|
|
28
|
+
var _getDay = require("date-fns/getDay");
|
|
29
|
+
var _getWeek = require("date-fns/getWeek");
|
|
15
30
|
var _locale = require("date-fns/locale");
|
|
16
31
|
var _tz = require("@date-fns/tz");
|
|
17
32
|
var _timezoneSoft = _interopRequireDefault(require("timezone-soft"));
|
|
@@ -108,7 +123,7 @@ class BaseDateTimeUtil {
|
|
|
108
123
|
weekStartsOn,
|
|
109
124
|
firstWeekContainsDate
|
|
110
125
|
} = this.getOptions();
|
|
111
|
-
return (0,
|
|
126
|
+
return (0, _parse.parse)(date, inputFormat, new Date(), {
|
|
112
127
|
in: this.getDateFnsContext(),
|
|
113
128
|
weekStartsOn,
|
|
114
129
|
firstWeekContainsDate
|
|
@@ -123,8 +138,8 @@ class BaseDateTimeUtil {
|
|
|
123
138
|
weekStartsOn
|
|
124
139
|
} = this.getOptions();
|
|
125
140
|
const parsedDate = this.toDate(date, inputFormat);
|
|
126
|
-
if ((0,
|
|
127
|
-
return (0,
|
|
141
|
+
if ((0, _isValid.isValid)(parsedDate)) {
|
|
142
|
+
return (0, _format.format)(parsedDate, targetFormat, {
|
|
128
143
|
in: this.getDateFnsContext(),
|
|
129
144
|
weekStartsOn,
|
|
130
145
|
locale: this.getLocale()
|
|
@@ -156,7 +171,7 @@ class BaseDateTimeUtil {
|
|
|
156
171
|
if (formattedValue === "Invalid Date") {
|
|
157
172
|
return false;
|
|
158
173
|
}
|
|
159
|
-
const isOutsideRange = (0,
|
|
174
|
+
const isOutsideRange = (0, _isBefore.isBefore)(parsedDate, new Date(1000, 1, 1)) || (0, _isAfter.isAfter)(parsedDate, new Date(9999, 11, 31));
|
|
160
175
|
if (isOutsideRange) {
|
|
161
176
|
return false;
|
|
162
177
|
}
|
|
@@ -171,14 +186,14 @@ class BaseDateTimeUtil {
|
|
|
171
186
|
return false;
|
|
172
187
|
}
|
|
173
188
|
const parsedDate = this.toDate(date, inputFormat);
|
|
174
|
-
return (0,
|
|
189
|
+
return (0, _isValid.isValid)(parsedDate);
|
|
175
190
|
}
|
|
176
191
|
|
|
177
192
|
/**
|
|
178
193
|
*/
|
|
179
194
|
isAfter(inputDate, afterISODate) {
|
|
180
195
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
181
|
-
return afterISODate != null && (0,
|
|
196
|
+
return afterISODate != null && (0, _isAfter.isAfter)(this.toDate(inputDate, inputFormat), this.toDate(afterISODate));
|
|
182
197
|
}
|
|
183
198
|
|
|
184
199
|
/**
|
|
@@ -192,7 +207,7 @@ class BaseDateTimeUtil {
|
|
|
192
207
|
*/
|
|
193
208
|
isBefore(inputDate, beforeISODate) {
|
|
194
209
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
195
|
-
return beforeISODate != null && (0,
|
|
210
|
+
return beforeISODate != null && (0, _isBefore.isBefore)(this.toDate(inputDate, inputFormat), this.toDate(beforeISODate));
|
|
196
211
|
}
|
|
197
212
|
|
|
198
213
|
/**
|
|
@@ -213,7 +228,7 @@ class BaseDateTimeUtil {
|
|
|
213
228
|
*/
|
|
214
229
|
isSameDay(inputDate, compareDate) {
|
|
215
230
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
216
|
-
return compareDate != null && (0,
|
|
231
|
+
return compareDate != null && (0, _isSameDay.isSameDay)(this.toDate(inputDate, inputFormat), this.toDate(compareDate, inputFormat));
|
|
217
232
|
}
|
|
218
233
|
|
|
219
234
|
/**
|
|
@@ -228,7 +243,7 @@ class BaseDateTimeUtil {
|
|
|
228
243
|
isWeekend(inputDate) {
|
|
229
244
|
const SATURDAY_NUMBER = 6;
|
|
230
245
|
const SUNDAY_NUMBER = 0;
|
|
231
|
-
const weekDay = (0,
|
|
246
|
+
const weekDay = (0, _getDay.getDay)(this.toDate(inputDate));
|
|
232
247
|
return weekDay === SATURDAY_NUMBER || weekDay === SUNDAY_NUMBER;
|
|
233
248
|
}
|
|
234
249
|
|
|
@@ -242,17 +257,17 @@ class BaseDateTimeUtil {
|
|
|
242
257
|
return false;
|
|
243
258
|
}
|
|
244
259
|
const dateTime = this.toDate(inputDate, inputFormat);
|
|
245
|
-
if (!(0,
|
|
260
|
+
if (!(0, _isValid.isValid)(dateTime)) {
|
|
246
261
|
return false;
|
|
247
262
|
}
|
|
248
263
|
const t = [60, -60, 30, -30];
|
|
249
264
|
const a = (0, _map.default)(t).call(t, x => {
|
|
250
|
-
const newDate = (0,
|
|
265
|
+
const newDate = (0, _add.add)(dateTime, {
|
|
251
266
|
minutes: x
|
|
252
267
|
});
|
|
253
|
-
return (0,
|
|
268
|
+
return (0, _format.format)(newDate, "HH:mm");
|
|
254
269
|
});
|
|
255
|
-
const time = (0,
|
|
270
|
+
const time = (0, _format.format)(dateTime, "HH:mm");
|
|
256
271
|
return a.indexOf(time) > -1;
|
|
257
272
|
}
|
|
258
273
|
|
|
@@ -275,98 +290,98 @@ class BaseDateTimeUtil {
|
|
|
275
290
|
*/
|
|
276
291
|
addSeconds(date, amount) {
|
|
277
292
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
278
|
-
return this._calculate(date,
|
|
293
|
+
return this._calculate(date, _add.add, "seconds", amount, inputFormat);
|
|
279
294
|
}
|
|
280
295
|
|
|
281
296
|
/**
|
|
282
297
|
*/
|
|
283
298
|
addMinutes(date, amount) {
|
|
284
299
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
285
|
-
return this._calculate(date,
|
|
300
|
+
return this._calculate(date, _add.add, "minutes", amount, inputFormat);
|
|
286
301
|
}
|
|
287
302
|
|
|
288
303
|
/**
|
|
289
304
|
*/
|
|
290
305
|
addHours(date, amount) {
|
|
291
306
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
292
|
-
return this._calculate(date,
|
|
307
|
+
return this._calculate(date, _add.add, "hours", amount, inputFormat);
|
|
293
308
|
}
|
|
294
309
|
|
|
295
310
|
/**
|
|
296
311
|
*/
|
|
297
312
|
addDays(date, amount) {
|
|
298
313
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
299
|
-
return this._calculate(date,
|
|
314
|
+
return this._calculate(date, _add.add, "days", amount, inputFormat);
|
|
300
315
|
}
|
|
301
316
|
|
|
302
317
|
/**
|
|
303
318
|
*/
|
|
304
319
|
addWeeks(date, amount) {
|
|
305
320
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
306
|
-
return this._calculate(date,
|
|
321
|
+
return this._calculate(date, _add.add, "weeks", amount, inputFormat);
|
|
307
322
|
}
|
|
308
323
|
|
|
309
324
|
/**
|
|
310
325
|
*/
|
|
311
326
|
addMonths(date, amount) {
|
|
312
327
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
313
|
-
return this._calculate(date,
|
|
328
|
+
return this._calculate(date, _add.add, "months", amount, inputFormat);
|
|
314
329
|
}
|
|
315
330
|
|
|
316
331
|
/**
|
|
317
332
|
*/
|
|
318
333
|
addYears(date, amount) {
|
|
319
334
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
320
|
-
return this._calculate(date,
|
|
335
|
+
return this._calculate(date, _add.add, "years", amount, inputFormat);
|
|
321
336
|
}
|
|
322
337
|
|
|
323
338
|
/**
|
|
324
339
|
*/
|
|
325
340
|
subtractSeconds(date, amount) {
|
|
326
341
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
327
|
-
return this._calculate(date,
|
|
342
|
+
return this._calculate(date, _sub.sub, "seconds", amount, inputFormat);
|
|
328
343
|
}
|
|
329
344
|
|
|
330
345
|
/**
|
|
331
346
|
*/
|
|
332
347
|
subtractMinutes(date, amount) {
|
|
333
348
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
334
|
-
return this._calculate(date,
|
|
349
|
+
return this._calculate(date, _sub.sub, "minutes", amount, inputFormat);
|
|
335
350
|
}
|
|
336
351
|
|
|
337
352
|
/**
|
|
338
353
|
*/
|
|
339
354
|
subtractHours(date, amount) {
|
|
340
355
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
341
|
-
return this._calculate(date,
|
|
356
|
+
return this._calculate(date, _sub.sub, "hours", amount, inputFormat);
|
|
342
357
|
}
|
|
343
358
|
|
|
344
359
|
/**
|
|
345
360
|
*/
|
|
346
361
|
subtractDays(date, amount) {
|
|
347
362
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
348
|
-
return this._calculate(date,
|
|
363
|
+
return this._calculate(date, _sub.sub, "days", amount, inputFormat);
|
|
349
364
|
}
|
|
350
365
|
|
|
351
366
|
/**
|
|
352
367
|
*/
|
|
353
368
|
subtractWeeks(date, amount) {
|
|
354
369
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
355
|
-
return this._calculate(date,
|
|
370
|
+
return this._calculate(date, _sub.sub, "weeks", amount, inputFormat);
|
|
356
371
|
}
|
|
357
372
|
|
|
358
373
|
/**
|
|
359
374
|
*/
|
|
360
375
|
subtractMonths(date, amount) {
|
|
361
376
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
362
|
-
return this._calculate(date,
|
|
377
|
+
return this._calculate(date, _sub.sub, "months", amount, inputFormat);
|
|
363
378
|
}
|
|
364
379
|
|
|
365
380
|
/**
|
|
366
381
|
*/
|
|
367
382
|
subtractYears(date, amount) {
|
|
368
383
|
let inputFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getIsoFormat();
|
|
369
|
-
return this._calculate(date,
|
|
384
|
+
return this._calculate(date, _sub.sub, "years", amount, inputFormat);
|
|
370
385
|
}
|
|
371
386
|
|
|
372
387
|
//////////// GETTERS
|
|
@@ -388,14 +403,14 @@ class BaseDateTimeUtil {
|
|
|
388
403
|
*/
|
|
389
404
|
startOfMonth(date) {
|
|
390
405
|
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
391
|
-
return this._get(date,
|
|
406
|
+
return this._get(date, _startOfMonth.startOfMonth, inputFormat);
|
|
392
407
|
}
|
|
393
408
|
|
|
394
409
|
/**
|
|
395
410
|
*/
|
|
396
411
|
endOfMonth(date) {
|
|
397
412
|
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
398
|
-
return this._get(date,
|
|
413
|
+
return this._get(date, _endOfMonth.endOfMonth, inputFormat);
|
|
399
414
|
}
|
|
400
415
|
|
|
401
416
|
/**
|
|
@@ -405,7 +420,7 @@ class BaseDateTimeUtil {
|
|
|
405
420
|
const {
|
|
406
421
|
weekStartsOn
|
|
407
422
|
} = this.getOptions();
|
|
408
|
-
return this._get(date,
|
|
423
|
+
return this._get(date, _startOfWeek.startOfWeek, inputFormat, {
|
|
409
424
|
weekStartsOn
|
|
410
425
|
});
|
|
411
426
|
}
|
|
@@ -415,7 +430,7 @@ class BaseDateTimeUtil {
|
|
|
415
430
|
getHours(date) {
|
|
416
431
|
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
417
432
|
const parsedDate = this.toDate(date, inputFormat);
|
|
418
|
-
return (0,
|
|
433
|
+
return (0, _getHours.getHours)(parsedDate, {
|
|
419
434
|
in: this.getDateFnsContext()
|
|
420
435
|
});
|
|
421
436
|
}
|
|
@@ -425,7 +440,7 @@ class BaseDateTimeUtil {
|
|
|
425
440
|
getMinutes(date) {
|
|
426
441
|
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
427
442
|
const parsedDate = this.toDate(date, inputFormat);
|
|
428
|
-
return (0,
|
|
443
|
+
return (0, _getMinutes.getMinutes)(parsedDate, {
|
|
429
444
|
in: this.getDateFnsContext()
|
|
430
445
|
});
|
|
431
446
|
}
|
|
@@ -439,7 +454,7 @@ class BaseDateTimeUtil {
|
|
|
439
454
|
firstWeekContainsDate
|
|
440
455
|
} = this.getOptions();
|
|
441
456
|
const parsedDate = this.toDate(date, inputFormat);
|
|
442
|
-
return (0,
|
|
457
|
+
return (0, _getWeek.getWeek)(parsedDate, {
|
|
443
458
|
in: this.getDateFnsContext(),
|
|
444
459
|
weekStartsOn,
|
|
445
460
|
firstWeekContainsDate
|
|
@@ -454,7 +469,7 @@ class BaseDateTimeUtil {
|
|
|
454
469
|
_set(date, property, value) {
|
|
455
470
|
let inputFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.getIsoFormat();
|
|
456
471
|
const parsedDate = this.toDate(date, inputFormat);
|
|
457
|
-
return this.toISO((0,
|
|
472
|
+
return this.toISO((0, _set.set)(parsedDate, {
|
|
458
473
|
[property]: value
|
|
459
474
|
}
|
|
460
475
|
// {
|
|
@@ -517,7 +532,7 @@ class BaseDateTimeUtil {
|
|
|
517
532
|
setTime(date, hours, minutes, seconds, milliseconds) {
|
|
518
533
|
let inputFormat = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : this.getIsoFormat();
|
|
519
534
|
const parsedDate = this.toDate(date, inputFormat);
|
|
520
|
-
return this.toISO((0,
|
|
535
|
+
return this.toISO((0, _set.set)(parsedDate, {
|
|
521
536
|
hours,
|
|
522
537
|
minutes,
|
|
523
538
|
seconds,
|
|
@@ -557,7 +572,7 @@ class BaseDateTimeUtil {
|
|
|
557
572
|
getOffset(date) {
|
|
558
573
|
let inputFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getIsoFormat();
|
|
559
574
|
const parsedDate = this.toDate(date, inputFormat);
|
|
560
|
-
if ((0,
|
|
575
|
+
if ((0, _isValid.isValid)(parsedDate)) {
|
|
561
576
|
const dateOffset = this.toFormat(parsedDate, _constants.DATETIME_OFFSET_FORMAT);
|
|
562
577
|
const offsets = this.getTimezoneOffsets();
|
|
563
578
|
if (typeof offsets.daylight !== "undefined" && offsets.daylight.value === dateOffset) {
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} from "date-fns";
|
|
2
|
+
import { format } from "date-fns/format";
|
|
3
|
+
import { isAfter } from "date-fns/isAfter";
|
|
4
|
+
import { isBefore } from "date-fns/isBefore";
|
|
5
|
+
import { isSameDay } from "date-fns/isSameDay";
|
|
6
|
+
import { isValid } from "date-fns/isValid";
|
|
7
|
+
import { parse } from "date-fns/parse";
|
|
8
|
+
import { add } from "date-fns/add";
|
|
9
|
+
import { sub } from "date-fns/sub";
|
|
10
|
+
import { set } from "date-fns/set";
|
|
11
|
+
import { startOfMonth } from "date-fns/startOfMonth";
|
|
12
|
+
import { endOfMonth } from "date-fns/endOfMonth";
|
|
13
|
+
import { startOfWeek } from "date-fns/startOfWeek";
|
|
14
|
+
import { getHours } from "date-fns/getHours";
|
|
15
|
+
import { getMinutes } from "date-fns/getMinutes";
|
|
16
|
+
import { getDay } from "date-fns/getDay";
|
|
17
|
+
import { getWeek } from "date-fns/getWeek";
|
|
18
|
+
|
|
20
19
|
import { enGB, nl } from "date-fns/locale";
|
|
21
20
|
import { tz } from "@date-fns/tz";
|
|
22
21
|
|