v1.0 with SW PWA enabled
This commit is contained in:
57
frontend/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js
generated
vendored
Normal file
57
frontend/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
exports.ISOTimezoneWithZParser = void 0;
|
||||
var _index = require("../../../constructFrom.js");
|
||||
var _index2 = require("../../../_lib/getTimezoneOffsetInMilliseconds.js");
|
||||
var _constants = require("../constants.js");
|
||||
var _Parser = require("../Parser.js");
|
||||
|
||||
var _utils = require("../utils.js");
|
||||
|
||||
// Timezone (ISO-8601. +00:00 is `'Z'`)
|
||||
class ISOTimezoneWithZParser extends _Parser.Parser {
|
||||
priority = 10;
|
||||
|
||||
parse(dateString, token) {
|
||||
switch (token) {
|
||||
case "X":
|
||||
return (0, _utils.parseTimezonePattern)(
|
||||
_constants.timezonePatterns.basicOptionalMinutes,
|
||||
dateString,
|
||||
);
|
||||
case "XX":
|
||||
return (0, _utils.parseTimezonePattern)(
|
||||
_constants.timezonePatterns.basic,
|
||||
dateString,
|
||||
);
|
||||
case "XXXX":
|
||||
return (0, _utils.parseTimezonePattern)(
|
||||
_constants.timezonePatterns.basicOptionalSeconds,
|
||||
dateString,
|
||||
);
|
||||
case "XXXXX":
|
||||
return (0, _utils.parseTimezonePattern)(
|
||||
_constants.timezonePatterns.extendedOptionalSeconds,
|
||||
dateString,
|
||||
);
|
||||
case "XXX":
|
||||
default:
|
||||
return (0, _utils.parseTimezonePattern)(
|
||||
_constants.timezonePatterns.extended,
|
||||
dateString,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
set(date, flags, value) {
|
||||
if (flags.timestampIsSet) return date;
|
||||
return (0, _index.constructFrom)(
|
||||
date,
|
||||
date.getTime() -
|
||||
(0, _index2.getTimezoneOffsetInMilliseconds)(date) -
|
||||
value,
|
||||
);
|
||||
}
|
||||
|
||||
incompatibleTokens = ["t", "T", "x"];
|
||||
}
|
||||
exports.ISOTimezoneWithZParser = ISOTimezoneWithZParser;
|
||||
Reference in New Issue
Block a user