@opengeoweb/webmap 4.13.0 → 4.13.1
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/index.esm.js +22 -7
- package/index.umd.js +22 -7
- package/lib/components/WMTime.d.ts +1 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -2700,7 +2700,7 @@ var getTimeValues = function getTimeValues(isotime) {
|
|
|
2700
2700
|
|
|
2701
2701
|
/** ************************************************* */
|
|
2702
2702
|
|
|
2703
|
-
var parseISO8601DateToDate = function parseISO8601DateToDate(
|
|
2703
|
+
var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime) {
|
|
2704
2704
|
/*
|
|
2705
2705
|
The following functions are added to the standard Date object:
|
|
2706
2706
|
- add(dateInterval) adds a DateInterval time to this time
|
|
@@ -2709,17 +2709,32 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(_isotime) {
|
|
|
2709
2709
|
- clone() creates a copy of this object
|
|
2710
2710
|
*/
|
|
2711
2711
|
|
|
2712
|
-
/**
|
|
2713
|
-
* https://
|
|
2714
|
-
*
|
|
2715
|
-
* Some WMS's also provide it in different forms like 1981-01 and 2021-12. Make it work with this format too.
|
|
2712
|
+
/** Timeformats according to:
|
|
2713
|
+
* https://portal.ogc.org/files/?artifact_id=14416 / 06-042_OpenGIS_Web_Map_Service_WMS_Implementation_Specification.pdf,
|
|
2714
|
+
* chapter D2.1 are supported
|
|
2716
2715
|
*/
|
|
2717
|
-
|
|
2716
|
+
var makeISO8601StringFromFlexibleWMSDateString = function makeISO8601StringFromFlexibleWMSDateString(isoString) {
|
|
2717
|
+
// Datestring starting with a - token are not supported.
|
|
2718
|
+
if (!isoString || isoString.startsWith('-')) return isoString;
|
|
2719
|
+
if (isoString.length === 4) return "".concat(isoString, "-01-01T00:00:00Z"); // YYYY
|
|
2720
|
+
|
|
2721
|
+
if (isoString.length === 7) return "".concat(isoString, "-01T00:00:00Z"); // YYYY-MM
|
|
2722
|
+
|
|
2723
|
+
if (isoString.length === 10) return "".concat(isoString, "T00:00:00Z"); // YYYY-MM-DD
|
|
2724
|
+
|
|
2725
|
+
if (isoString.length === 14) return "".concat(isoString.slice(0, -1), ":00:00Z"); // YYYY-MM-DDTHHZ
|
|
2726
|
+
|
|
2727
|
+
return isoString;
|
|
2728
|
+
};
|
|
2729
|
+
|
|
2730
|
+
var isotime = makeISO8601StringFromFlexibleWMSDateString(unvalidatedIsotime);
|
|
2731
|
+
|
|
2732
|
+
if (!isValidISOTime(isotime)) {
|
|
2718
2733
|
debug(DebugType.Warning);
|
|
2719
2734
|
return undefined;
|
|
2720
2735
|
}
|
|
2721
2736
|
|
|
2722
|
-
var _getTimeValues = getTimeValues(
|
|
2737
|
+
var _getTimeValues = getTimeValues(isotime),
|
|
2723
2738
|
_getTimeValues2 = _slicedToArray(_getTimeValues, 6),
|
|
2724
2739
|
year = _getTimeValues2[0],
|
|
2725
2740
|
month = _getTimeValues2[1],
|
package/index.umd.js
CHANGED
|
@@ -2699,7 +2699,7 @@
|
|
|
2699
2699
|
|
|
2700
2700
|
/** ************************************************* */
|
|
2701
2701
|
|
|
2702
|
-
var parseISO8601DateToDate = function parseISO8601DateToDate(
|
|
2702
|
+
var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime) {
|
|
2703
2703
|
/*
|
|
2704
2704
|
The following functions are added to the standard Date object:
|
|
2705
2705
|
- add(dateInterval) adds a DateInterval time to this time
|
|
@@ -2708,17 +2708,32 @@
|
|
|
2708
2708
|
- clone() creates a copy of this object
|
|
2709
2709
|
*/
|
|
2710
2710
|
|
|
2711
|
-
/**
|
|
2712
|
-
* https://
|
|
2713
|
-
*
|
|
2714
|
-
* Some WMS's also provide it in different forms like 1981-01 and 2021-12. Make it work with this format too.
|
|
2711
|
+
/** Timeformats according to:
|
|
2712
|
+
* https://portal.ogc.org/files/?artifact_id=14416 / 06-042_OpenGIS_Web_Map_Service_WMS_Implementation_Specification.pdf,
|
|
2713
|
+
* chapter D2.1 are supported
|
|
2715
2714
|
*/
|
|
2716
|
-
|
|
2715
|
+
var makeISO8601StringFromFlexibleWMSDateString = function makeISO8601StringFromFlexibleWMSDateString(isoString) {
|
|
2716
|
+
// Datestring starting with a - token are not supported.
|
|
2717
|
+
if (!isoString || isoString.startsWith('-')) return isoString;
|
|
2718
|
+
if (isoString.length === 4) return isoString + "-01-01T00:00:00Z"; // YYYY
|
|
2719
|
+
|
|
2720
|
+
if (isoString.length === 7) return isoString + "-01T00:00:00Z"; // YYYY-MM
|
|
2721
|
+
|
|
2722
|
+
if (isoString.length === 10) return isoString + "T00:00:00Z"; // YYYY-MM-DD
|
|
2723
|
+
|
|
2724
|
+
if (isoString.length === 14) return isoString.slice(0, -1) + ":00:00Z"; // YYYY-MM-DDTHHZ
|
|
2725
|
+
|
|
2726
|
+
return isoString;
|
|
2727
|
+
};
|
|
2728
|
+
|
|
2729
|
+
var isotime = makeISO8601StringFromFlexibleWMSDateString(unvalidatedIsotime);
|
|
2730
|
+
|
|
2731
|
+
if (!isValidISOTime(isotime)) {
|
|
2717
2732
|
debug(exports.DebugType.Warning, 'No date given to parseISO8601DateToDate');
|
|
2718
2733
|
return undefined;
|
|
2719
2734
|
}
|
|
2720
2735
|
|
|
2721
|
-
var _a = __read(getTimeValues(
|
|
2736
|
+
var _a = __read(getTimeValues(isotime), 6),
|
|
2722
2737
|
year = _a[0],
|
|
2723
2738
|
month = _a[1],
|
|
2724
2739
|
day = _a[2],
|
|
@@ -18,7 +18,7 @@ export declare const parseTimeValue: (value: string) => number;
|
|
|
18
18
|
export declare const getTimeValues: (isotime: string) => number[];
|
|
19
19
|
/** ************************************************* */
|
|
20
20
|
/** ************************************************* */
|
|
21
|
-
export declare const parseISO8601DateToDate: (
|
|
21
|
+
export declare const parseISO8601DateToDate: (unvalidatedIsotime: string) => CustomDate;
|
|
22
22
|
/** ****************************************************** */
|
|
23
23
|
/** ****************************************************** */
|
|
24
24
|
export declare const parseISO8601IntervalToDateInterval: (isotime: string) => DateInterval;
|