All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.account.resources.util.TimeUtil.js.map Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
{"version":3,"file":"TimeUtil.js","names":["TimeUtil","constructor","_defineProperty","year","month","day","hour","minute","formatter","Intl","DateTimeFormat","locale","options","e","format","time","TimeUtilInstance"],"sources":["../../src/app/util/TimeUtil.ts"],"sourcesContent":["/*\n * Copyright 2020 Red Hat, Inc. and/or its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ndeclare const locale: string;\n\n/**\n * @author Stan Silvert\n */\nclass TimeUtil {\n    private options: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };\n    private formatter: Intl.DateTimeFormat;\n\n    constructor() {\n        try {\n            this.formatter = new Intl.DateTimeFormat(locale, this.options);\n        } catch(e) {\n            // unknown locale falling back to English\n            this.formatter = new Intl.DateTimeFormat('en', this.options);\n        }\n    }\n\n    format(time: number): string {\n        return this.formatter.format(time);\n    }\n}\n\nconst TimeUtilInstance: TimeUtil = new TimeUtil();\nexport default TimeUtilInstance as TimeUtil;"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMA,QAAQ,CAAC;EAIXC,WAAWA,CAAA,EAAG;IAAAC,eAAA,kBAHgC;MAAEC,IAAI,EAAE,SAAS;MAAEC,KAAK,EAAE,MAAM;MAAEC,GAAG,EAAE,SAAS;MAAEC,IAAI,EAAE,SAAS;MAAEC,MAAM,EAAE;IAAU,CAAC;IAAAL,eAAA;IAIhI,IAAI;MACA,IAAI,CAACM,SAAS,GAAG,IAAIC,IAAI,CAACC,cAAc,CAACC,MAAM,EAAE,IAAI,CAACC,OAAO,CAAC;IAClE,CAAC,CAAC,OAAMC,CAAC,EAAE;MACP;MACA,IAAI,CAACL,SAAS,GAAG,IAAIC,IAAI,CAACC,cAAc,CAAC,IAAI,EAAE,IAAI,CAACE,OAAO,CAAC;IAChE;EACJ;EAEAE,MAAMA,CAACC,IAAY,EAAU;IACzB,OAAO,IAAI,CAACP,SAAS,CAACM,MAAM,CAACC,IAAI,CAAC;EACtC;AACJ;AAEA,MAAMC,gBAA0B,GAAG,IAAIhB,QAAQ,CAAC,CAAC;AACjD,eAAegB,gBAAgB"}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy