{"version":3,"sources":["webpack://jrs-ui/../js-sdk/src/common/extension/jQueryDatepickerExtension.js","webpack://jrs-ui/../js-sdk/src/common/extension/jQueryTimepickerExtension.js","webpack://jrs-ui/../js-sdk/src/common/util/datetime/RelativeDate.js","webpack://jrs-ui/../js-sdk/src/common/util/datetime/RelativeTimestamp.js","webpack://jrs-ui/../js-sdk/src/common/util/parse/date.js"],"names":["_jasperPrefix","_mainDivId","$","_jasperPopupClass","originalNewInst","result","apply","arguments","dpDiv","removeClass","addClass","originalGoToToday","id","call","this","_selectDate","$input","opts","onChangeMonthYear","year","month","datepicker","timepicker","currentYear","selectedYear","currentMonth","selectedMonth","currentDay","selectedDay","_updateDateTime","instance","originalOnTimeChange","_onTimeChange","$timeObj","setSelectionRange","RelativeDate","keyword","sign","number","setKeyword","setSign","setNumber","prototype","toUpperCase","_","value","parseInt","isNaN","toString","PATTERNS","DAY","WEEK","MONTH","QUARTER","SEMI","YEAR","parse","relativeDateString","isValid","pattern","exec","length","relativeDate","test","RelativeTimestamp","F","constructor","relativeTimestampString","relativeTimestamp","localeSettingsObject","jrsConfigs","userTimezone","ISO_8601_TIMESTAMP_PATTERN","ISO_8601_DATE_PATTERN","ISO_8601_TIME_PATTERN","toMomentDatePattern","dateFormat","indexOf","replace","fromJavaToMomentDatePattern","toMomentTimePattern","timeFormat","toLowerCase","fromJavaToMomentTimePattern","toMomentTimestampPattern","separator","dateStringToMoment","moment","timestampStringToMoment","timestampSeparator","isDate","isTimestamp","compareMoments","moment1","moment2","isBefore","isAfter","localizedTimestampToIsoTimestamp","localizedTimestampString","convert","localizedDateToIsoDate","localizedDateString","fromPattern","toPattern","momentValue","format","isRelativeDate","isRelativeTimestamp","isIso8601Timestamp","compareDates","value1","value2","compareTimestamps","iso8601DateToMoment","isoDateString","momentToIso8601Date","momentDate","momentToLocalizedDate","dateObjectToIso8601Timestamp","iso8601TimestampToDateObject","toDate","isoTimestampToLocalizedTimestamp","isoTimestampString","isoDateToLocalizedDate","localizedTimeToIsoTime","localizedTimeString","isoTimeToLocalizedTime","isoTimeString","toMomentDateOrTimeOrTimestampPattern","dateOrTimeOrTimestampFormat","dateTimeSeparator","fromJava","formatAsArray","split","toDatePattern","toTimePattern","isoDateToLocalizedDateByTimezone","timezone","tz","localizedDateToIsoDateByTimezone","utc","isoTimeToLocalizedTimeByTimezone","duration","utcMoment","hours","minutes","seconds","localizedTimeToIsoTimeByTimezone","timezoneMoment","isoTimestampToLocalizedTimestampByTimezone","localizedTimestampToIsoTimestampByTimezone","momentTimestamp"],"mappings":"wHAyBIA,G,SAAgB,MAIhBC,EAAaD,MADEE,0BAAwB,MAG3CA,0BAA0BD,EAE1BC,0BAAwB,KAAMD,GAE9BC,mCAMAA,8BAJiBC,8GAMjB,IAAIC,EAAkBF,wBAEtBA,wBAAwB,WACpB,IAAIG,EAASD,EAAgBE,MAAMJ,eAAcK,WAKjD,OAHAF,EAAOG,MAAMC,YAAYT,GACzBK,EAAOG,MAAME,SAASV,GAEfK,GAGX,IAAIM,EAAoBT,0BAExBA,0BAA0B,SAASU,GAC/BD,EAAkBE,KAAKC,KAAMF,GAC7BE,KAAKC,YAAYH,I,6BC/BjBR,EAAkBF,wBAEtBA,wBAAwB,SAASc,EAAQC,GAChCA,EAAKC,oBACND,EAAKC,kBAAoB,SAASC,EAAMC,EAAOC,EAAYC,GACvDD,EAAWE,YAAcF,EAAWG,aACpCH,EAAWI,aAAeJ,EAAWK,cACrCL,EAAWM,WAAaN,EAAWO,YAEnCN,EAAWO,gBAAgBR,KAInC,IAAIS,EAAW1B,EAAgBS,KAAKX,eAAcc,EAAQC,GAEtDc,EAAuBD,EAASE,cAQpC,OANAF,EAASE,cAAgB,WAGrB,OAFAlB,KAAKmB,SAAS,GAAGC,kBAAoB,KAE9BH,EAAqBzB,MAAMQ,KAAMP,YAGrCuB,I,sEC5BPK,EAAe,SAAUC,EAASC,EAAMC,GACxCxB,KAAKyB,WAAWH,GAChBtB,KAAK0B,QAAQH,GACbvB,KAAK2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hC,IA8DzBoE,iCAxGJ,SAA0ChG,EAAO4F,GAC7C,IAAIK,EAAWvD,aAAgB1C,GAE3BkG,EAAYxD,UAUhB,OARIkD,GACAM,EAAUL,GAAGD,GAGjBM,EAAUC,MAAMF,EAASE,SACzBD,EAAUE,QAAQH,EAASG,WAC3BF,EAAUG,QAAQJ,EAASI,WAEpBH,EAAUL,GAAGnE,GAAckC,OAAOzB,EAAoBX,EAAqBY,cA4FlFkE,iCA5DJ,SAA0CtG,EAAO4F,GAC7C,IAAIK,EAAWvD,aAAgB1C,GAI3BuG,EAFY7D,UAEemD,GAAGnE,GAelC,OAbA6E,EAAeJ,MAAMF,EAASE,SAC9BI,EAAeH,QAAQH,EAASG,WAChCG,EAAeF,QAAQJ,EAASI,YAI5BT,EACaW,EAAeV,GAAGD,GAElBW,EAAeR,OAIdnC,OAAO/B,IAyCzB2E,2CA1FJ,SAAoDxG,EAAO4F,GASvD,OANIA,EACkBlD,OAAU1C,EAAO4F,GAAUC,GAAGnE,GAE9BgB,QAAW1C,GAAO6F,GAAGnE,IAGpBkC,OAAOrB,EAC1Bf,EAAqBO,WACrBP,EAAqBY,WACrBZ,EAAqBoB,sBA+EzB6D,2CAvCJ,SAAoDzG,EAAO4F,GACvD5F,EAAQoD,EAAiCpD,GAEzC,IAAI0G,EAAkBhE,OAAU1C,EAAO0B,GAQvC,OALIgF,EADAd,EACkBc,EAAgBb,GAAGD,GAEnBc,EAAgBX,OAGfnC,OAAOjC","file":"_chunks/chunk.936.js","sourcesContent":["/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport $ from 'jquery';\n\nimport 'jquery-ui/ui/widgets/datepicker';\n\nvar _jasperPrefix = \"jr\";\nvar _jasperPopupClass = \"jr-jDatepickerPopupContainer\";\n\nvar datepickerId = $.datepicker.dpDiv.attr(\"id\"),\n _mainDivId = _jasperPrefix + \"-\" + datepickerId;\n\n$.datepicker._mainDivId = _mainDivId;\n\n$.datepicker.dpDiv.attr(\"id\", _mainDivId);\n\n$.datepicker.dpDiv.removeClass();\n\nvar dpDivClass = _jasperPopupClass\n + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all '\n + _jasperPrefix;\n\n$.datepicker.dpDiv.addClass(dpDivClass);\n\nvar originalNewInst = $.datepicker._newInst;\n\n$.datepicker._newInst = function() {\n var result = originalNewInst.apply($.datepicker, arguments);\n\n result.dpDiv.removeClass(_jasperPrefix);\n result.dpDiv.addClass(_jasperPrefix);\n\n return result;\n};\n\nvar originalGoToToday = $.datepicker._gotoToday;\n\n$.datepicker._gotoToday = function(id) {\n originalGoToToday.call(this, id);\n this._selectDate(id);\n};\n\nexport default $;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport $ from 'jquery';\n\nimport './jQueryDatepickerExtension';\nimport './jQueryUiSliderAccessExtension';\nimport 'jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon';\n\nvar originalNewInst = $.timepicker._newInst;\n\n$.timepicker._newInst = function($input, opts) {\n if (!opts.onChangeMonthYear) {\n opts.onChangeMonthYear = function(year, month, datepicker, timepicker) {\n datepicker.currentYear = datepicker.selectedYear;\n datepicker.currentMonth = datepicker.selectedMonth;\n datepicker.currentDay = datepicker.selectedDay;\n\n timepicker._updateDateTime(datepicker);\n };\n }\n\n var instance = originalNewInst.call($.timepicker, $input, opts);\n\n var originalOnTimeChange = instance._onTimeChange;\n\n instance._onTimeChange = function() {\n this.$timeObj[0].setSelectionRange = null;\n\n return originalOnTimeChange.apply(this, arguments);\n };\n\n return instance;\n};\n\nexport default $;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport _ from 'underscore';\nvar RelativeDate = function (keyword, sign, number) {\n this.setKeyword(keyword);\n this.setSign(sign);\n this.setNumber(number);\n};\nRelativeDate.prototype.setKeyword = function (keyword) {\n this.keyword = keyword.toUpperCase();\n};\nRelativeDate.prototype.setSign = function (sign) {\n this.sign = sign;\n};\nRelativeDate.prototype.setNumber = function (number) {\n if (_.isNumber(number)) {\n this.number = number;\n } else {\n var value = parseInt(number, 10);\n if (!isNaN(value)) {\n this.number = value;\n } else {\n this.number = 0;\n }\n }\n};\nRelativeDate.prototype.toString = function () {\n if (_.isNumber(this.number) && !isNaN(this.number) && this.number > 0 && (this.sign === '+' || this.sign === '-') && this.keyword in RelativeDate.PATTERNS) {\n return this.keyword + this.sign + this.number.toString();\n } else if (this.keyword in RelativeDate.PATTERNS) {\n return this.keyword;\n } else {\n return '';\n }\n};\nRelativeDate.PATTERNS = {\n DAY: /^(DAY)(([+|\\-])(\\d{1,9}))?$/i,\n WEEK: /^(WEEK)(([+|\\-])(\\d{1,9}))?$/i,\n MONTH: /^(MONTH)(([+|\\-])(\\d{1,9}))?$/i,\n QUARTER: /^(QUARTER)(([+|\\-])(\\d{1,9}))?$/i,\n SEMI: /^(SEMI)(([+|\\-])(\\d{1,9}))?$/i,\n YEAR: /^(YEAR)(([+|\\-])(\\d{1,9}))?$/i\n};\nRelativeDate.parse = function (relativeDateString) {\n if (RelativeDate.isValid(relativeDateString)) {\n for (var pattern in RelativeDate.PATTERNS) {\n var result = RelativeDate.PATTERNS[pattern].exec(relativeDateString);\n if (result !== null && _.isArray(result) && result.length === 5) {\n return new RelativeDate(result[1], result[3], result[4]);\n }\n }\n }\n return undefined;\n};\nRelativeDate.isValid = function (relativeDate) {\n if (relativeDate instanceof RelativeDate) {\n return relativeDate.toString() !== '';\n } else if (_.isString(relativeDate)) {\n for (var pattern in RelativeDate.PATTERNS) {\n if (RelativeDate.PATTERNS[pattern].test(relativeDate)) {\n return true;\n }\n }\n }\n return false;\n};\nexport default RelativeDate;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport RelativeDate from './RelativeDate';\nimport _ from 'underscore';\nvar RelativeTimestamp = function () {\n RelativeDate.apply(this, arguments);\n};\nvar F = function () {\n};\nF.prototype = RelativeDate.prototype;\nRelativeTimestamp.prototype = new F();\nRelativeTimestamp.prototype.constructor = RelativeTimestamp;\nRelativeTimestamp.PATTERNS = {\n DAY: /^(DAY)(([+|\\-])(\\d{1,9}))?$/i,\n WEEK: /^(WEEK)(([+|\\-])(\\d{1,9}))?$/i,\n MONTH: /^(MONTH)(([+|\\-])(\\d{1,9}))?$/i,\n QUARTER: /^(QUARTER)(([+|\\-])(\\d{1,9}))?$/i,\n SEMI: /^(SEMI)(([+|\\-])(\\d{1,9}))?$/i,\n YEAR: /^(YEAR)(([+|\\-])(\\d{1,9}))?$/i\n};\nRelativeTimestamp.parse = function (relativeTimestampString) {\n if (RelativeTimestamp.isValid(relativeTimestampString)) {\n for (var pattern in RelativeTimestamp.PATTERNS) {\n var result = RelativeTimestamp.PATTERNS[pattern].exec(relativeTimestampString);\n if (result !== null && _.isArray(result) && result.length === 5) {\n return new RelativeTimestamp(result[1], result[3], result[4]);\n }\n }\n }\n return undefined;\n};\nRelativeTimestamp.isValid = function (relativeTimestamp) {\n if (relativeTimestamp instanceof RelativeTimestamp) {\n return relativeTimestamp.toString() !== '';\n } else if (_.isString(relativeTimestamp)) {\n for (var pattern in RelativeTimestamp.PATTERNS) {\n if (RelativeTimestamp.PATTERNS[pattern].test(relativeTimestamp)) {\n return true;\n }\n }\n }\n return false;\n};\nexport default RelativeTimestamp;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport moment from 'moment';\nimport jrsConfigs from \"../../../jrs.configs\";\nimport _ from 'underscore';\nimport RelativeDate from '../datetime/RelativeDate';\nimport RelativeTimestamp from '../datetime/RelativeTimestamp';\n\nlet localeSettingsObject = jrsConfigs.localeSettings;\n\nvar userTimezone = jrsConfigs.userTimezone;\n\nvar ISO_8601_TIMESTAMP_PATTERN = \"YYYY-MM-DD[T]HH:mm:ss\",\n ISO_8601_DATE_PATTERN = \"YYYY-MM-DD\",\n ISO_8601_TIME_PATTERN = \"HH:mm:ss\";\n\nfunction toMomentDatePattern(dateFormat) {\n var result = dateFormat;\n\n //convert year part of the format\n if (dateFormat.indexOf(\"yy\") > -1) {\n result = result.replace(\"yy\", \"YYYY\"); // four digit year: 2015\n } else {\n result = result.replace(\"y\", \"YY\"); // two digit year: 15\n }\n\n\n //convert month part of the format\n if (dateFormat.indexOf(\"mm\") > -1) {\n result = result.replace(\"mm\", \"MM\"); // two digit month with leading zero: 02\n } else if (dateFormat.indexOf(\"MM\") > -1) {\n result = result.replace(\"MM\", \"MMMM\"); // Long month name: February\n } else if (dateFormat.indexOf(\"m\") > -1) {\n result = result.replace(\"m\", \"M\"); // two digit month withoud leading zero: 2\n } else if (dateFormat.indexOf(\"M\") > -1) {\n result = result.replace(\"M\", \"MMM\"); // Short month name: Feb\n }\n\n\n //convert day part of the format\n if (dateFormat.indexOf(\"dd\") > -1) {\n result = result.replace(\"dd\", \"DD\"); // day of month (two digit): 02\n } else if (dateFormat.indexOf(\"DD\") > -1) {\n result = result.replace(\"DD\", \"dddd\"); // week day name long: Monday\n } else if (dateFormat.indexOf(\"d\") > -1) {\n result = result.replace(\"d\", \"D\"); // day of month (two digit) without leading zero: 2\n } else if (dateFormat.indexOf(\"D\") > -1) {\n result = result.replace(\"D\", \"ddd\"); // week day short day name: Mon\n }\n\n return result;\n}\n\nfunction fromJavaToMomentDatePattern(dateFormat) {\n return dateFormat.toUpperCase();\n}\n\nfunction toMomentTimePattern(timeFormat) {\n return timeFormat.toLowerCase().replace(/h/g, \"H\");\n}\n\nfunction fromJavaToMomentTimePattern(timeFormat) {\n return timeFormat.replace(\"aaa\", \"a\");\n}\n\nfunction toMomentTimestampPattern(dateFormat, timeFormat, separator) {\n var datePattern = toMomentDatePattern(dateFormat),\n timePattern = toMomentTimePattern(timeFormat);\n\n return datePattern + (separator != null ? separator : \" \") + timePattern;\n}\n\nfunction toMomentDateOrTimeOrTimestampPattern(dateOrTimeOrTimestampFormat, dateTimeSeparator, fromJava) {\n fromJava = typeof fromJava !== \"undefined\" ? fromJava : false;\n dateTimeSeparator = dateTimeSeparator || \" \";\n\n var formatAsArray = dateOrTimeOrTimestampFormat.split(dateTimeSeparator);\n var dateFormat = formatAsArray[0];\n var timeFormat = formatAsArray.length > 1 ? formatAsArray[1] : null;\n\n var toDatePattern = fromJava ? fromJavaToMomentDatePattern : toMomentDatePattern;\n var toTimePattern = fromJava ? fromJavaToMomentTimePattern : toMomentTimePattern;\n\n if ((dateFormat.indexOf('h') >= 0) || (dateFormat.indexOf('H') >= 0) || dateFormat.indexOf(\"s\") >= 0) {\n timeFormat = dateFormat;\n dateFormat = null;\n }\n\n var result = \"\";\n\n if (dateFormat) {\n result += toDatePattern(dateFormat);\n }\n\n if (timeFormat) {\n if (result) {\n result += dateTimeSeparator;\n }\n\n result += toTimePattern(timeFormat);\n }\n\n return result;\n}\n\nfunction dateStringToMoment(value) {\n return moment(value, toMomentDatePattern(localeSettingsObject.dateFormat), true);\n}\n\nfunction timestampStringToMoment(value) {\n return moment(value, toMomentTimestampPattern(\n localeSettingsObject.dateFormat,\n localeSettingsObject.timeFormat,\n localeSettingsObject.timestampSeparator), true);\n}\n\nfunction isRelativeDate(value) {\n return RelativeDate.isValid(value);\n}\n\nfunction isRelativeTimestamp(value) {\n return RelativeTimestamp.isValid(value);\n}\n\nfunction isDate(value) {\n return (_.isDate(value) && moment(value).isValid())\n || (_.isString(value) && value !== \"\" && dateStringToMoment(value).isValid());\n}\n\nfunction isTimestamp(value) {\n return (_.isDate(value) && moment(value).isValid())\n || (_.isString(value) && value !== \"\" && timestampStringToMoment(value).isValid());\n}\n\nfunction isIso8601Timestamp(value) {\n return moment(value, ISO_8601_TIMESTAMP_PATTERN, true).isValid();\n}\n\nfunction compareDates(value1, value2) {\n if (!isDate(value1) || !isDate(value2)) {\n return;\n }\n\n var moment1 = _.isDate(value1) ? moment(value1) : dateStringToMoment(value1),\n moment2 = _.isDate(value2) ? moment(value2) : dateStringToMoment(value2);\n\n return compareMoments(moment1, moment2);\n}\n\nfunction compareTimestamps(value1, value2) {\n if (!isTimestamp(value1) || !isTimestamp(value2)) {\n return;\n }\n\n var moment1 = _.isDate(value1) ? moment(value1) : timestampStringToMoment(value1),\n moment2 = _.isDate(value2) ? moment(value2) : timestampStringToMoment(value2);\n\n return compareMoments(moment1, moment2);\n}\n\nfunction compareMoments(moment1, moment2) {\n if (moment1.isBefore(moment2)) {\n return -1;\n } else if (moment1.isAfter(moment2)) {\n return 1;\n } else {\n return 0;\n }\n}\n\nfunction dateObjectToIso8601Timestamp(value) {\n var momentDate = moment(value);\n\n if (_.isDate(value) && momentDate.isValid()) {\n return momentDate.format(ISO_8601_TIMESTAMP_PATTERN);\n }\n\n return undefined;\n}\n\nfunction iso8601TimestampToDateObject(value) {\n var momentDate = moment(value, ISO_8601_TIMESTAMP_PATTERN, true);\n\n if (momentDate.isValid()) {\n return momentDate.toDate();\n }\n\n return undefined;\n}\n\nfunction localizedTimestampToIsoTimestamp(localizedTimestampString){\n return convert(localizedTimestampString, toMomentTimestampPattern(\n localeSettingsObject.dateFormat,\n localeSettingsObject.timeFormat,\n localeSettingsObject.timestampSeparator), ISO_8601_TIMESTAMP_PATTERN);\n}\n\nfunction isoTimestampToLocalizedTimestamp(isoTimestampString){\n return convert(isoTimestampString, ISO_8601_TIMESTAMP_PATTERN, toMomentTimestampPattern(\n localeSettingsObject.dateFormat,\n localeSettingsObject.timeFormat,\n localeSettingsObject.timestampSeparator));\n}\n\nfunction localizedDateToIsoDate(localizedDateString){\n return convert(localizedDateString, toMomentDatePattern(localeSettingsObject.dateFormat), ISO_8601_DATE_PATTERN);\n}\n\nfunction isoDateToLocalizedDate(isoDateString){\n return convert(isoDateString, ISO_8601_DATE_PATTERN, toMomentDatePattern(localeSettingsObject.dateFormat));\n}\n\nfunction localizedTimeToIsoTime(localizedTimeString){\n return convert(localizedTimeString, toMomentTimePattern(localeSettingsObject.timeFormat), ISO_8601_TIME_PATTERN);\n}\n\nfunction isoTimeToLocalizedTime(isoTimeString){\n return convert(isoTimeString, ISO_8601_TIME_PATTERN, toMomentTimePattern(localeSettingsObject.timeFormat));\n}\n\nfunction convert(value, fromPattern, toPattern) {\n if (RelativeDate.isValid(value)) {\n // return original value if it's relative date\n return value;\n }\n var momentValue = moment(value, fromPattern, true);\n if (momentValue.isValid()) {\n // return formatted value if valid date\n return momentValue.format(toPattern);\n } else {\n // return original value if invalid\n return value;\n }\n}\n\nfunction iso8601DateToMoment(isoDateString) {\n return moment(isoDateString, ISO_8601_DATE_PATTERN, true);\n}\nfunction momentToIso8601Date(momentDate) {\n return momentDate.format(ISO_8601_DATE_PATTERN);\n}\nfunction momentToLocalizedDate(momentDate) {\n return momentDate.format(toMomentDatePattern(localeSettingsObject.dateFormat));\n}\n\nfunction isoDateToLocalizedDateByTimezone(value, timezone) {\n var momentDate;\n\n if (timezone) {\n momentDate = moment.tz(value, timezone).tz(userTimezone);\n } else {\n momentDate = moment.utc(value).tz(userTimezone);\n }\n\n return momentDate.format(toMomentDatePattern(localeSettingsObject.dateFormat));\n}\n\nfunction isoTimeToLocalizedTimeByTimezone(value, timezone) {\n var duration = moment.duration(value);\n\n var utcMoment = moment.utc();\n\n if (timezone) {\n utcMoment.tz(timezone);\n }\n\n utcMoment.hours(duration.hours());\n utcMoment.minutes(duration.minutes());\n utcMoment.seconds(duration.seconds());\n\n return utcMoment.tz(userTimezone).format(toMomentTimePattern(localeSettingsObject.timeFormat));\n}\n\nfunction isoTimestampToLocalizedTimestampByTimezone(value, timezone) {\n var momentTimestamp;\n\n if (timezone) {\n momentTimestamp = moment.tz(value, timezone).tz(userTimezone);\n } else {\n momentTimestamp = moment.utc(value).tz(userTimezone);\n }\n\n return momentTimestamp.format(toMomentTimestampPattern(\n localeSettingsObject.dateFormat,\n localeSettingsObject.timeFormat,\n localeSettingsObject.timestampSeparator));\n}\n\nfunction localizedDateToIsoDateByTimezone(value, timezone) {\n value = localizedDateToIsoDate(value);\n\n var momentDate = moment.tz(value, userTimezone);\n\n if (timezone) {\n momentDate = momentDate.tz(timezone);\n } else {\n momentDate = momentDate.utc();\n }\n\n return momentDate.format(ISO_8601_DATE_PATTERN);\n}\n\nfunction localizedTimeToIsoTimeByTimezone(value, timezone) {\n var duration = moment.duration(value);\n\n var utcMoment = moment.utc();\n\n var timezoneMoment = utcMoment.tz(userTimezone);\n\n timezoneMoment.hours(duration.hours());\n timezoneMoment.minutes(duration.minutes());\n timezoneMoment.seconds(duration.seconds());\n\n var momentTime;\n\n if (timezone) {\n momentTime = timezoneMoment.tz(timezone);\n } else {\n momentTime = timezoneMoment.utc();\n }\n\n\n return momentTime.format(ISO_8601_TIME_PATTERN);\n}\n\nfunction localizedTimestampToIsoTimestampByTimezone(value, timezone) {\n value = localizedTimestampToIsoTimestamp(value);\n\n var momentTimestamp = moment.tz(value, userTimezone);\n\n if (timezone) {\n momentTimestamp = momentTimestamp.tz(timezone);\n } else {\n momentTimestamp = momentTimestamp.utc();\n }\n\n return momentTimestamp.format(ISO_8601_TIMESTAMP_PATTERN);\n}\n\nexport default {\n isRelativeDate: isRelativeDate,\n isRelativeTimestamp: isRelativeTimestamp,\n isDate: isDate,\n isTimestamp: isTimestamp,\n isIso8601Timestamp: isIso8601Timestamp,\n compareDates: compareDates,\n compareTimestamps: compareTimestamps,\n iso8601DateToMoment: iso8601DateToMoment,\n momentToIso8601Date: momentToIso8601Date,\n momentToLocalizedDate: momentToLocalizedDate,\n dateObjectToIso8601Timestamp: dateObjectToIso8601Timestamp,\n iso8601TimestampToDateObject: iso8601TimestampToDateObject,\n localizedTimestampToIsoTimestamp: localizedTimestampToIsoTimestamp,\n isoTimestampToLocalizedTimestamp: isoTimestampToLocalizedTimestamp,\n localizedDateToIsoDate: localizedDateToIsoDate,\n isoDateToLocalizedDate: isoDateToLocalizedDate,\n localizedTimeToIsoTime: localizedTimeToIsoTime,\n isoTimeToLocalizedTime: isoTimeToLocalizedTime,\n toMomentDateOrTimeOrTimestampPattern: toMomentDateOrTimeOrTimestampPattern,\n isoDateToLocalizedDateByTimezone: isoDateToLocalizedDateByTimezone,\n localizedDateToIsoDateByTimezone: localizedDateToIsoDateByTimezone,\n isoTimeToLocalizedTimeByTimezone: isoTimeToLocalizedTimeByTimezone,\n localizedTimeToIsoTimeByTimezone: localizedTimeToIsoTimeByTimezone,\n isoTimestampToLocalizedTimestampByTimezone: isoTimestampToLocalizedTimestampByTimezone,\n localizedTimestampToIsoTimestampByTimezone: localizedTimestampToIsoTimestampByTimezone\n}"],"sourceRoot":""}