UNPKG

igniteui-webcomponents-inputs

Version:

Ignite UI Web Components inputs components.

107 lines (106 loc) 4.09 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { Base, markType } from "igniteui-webcomponents-core"; import { dateMinValue } from "igniteui-webcomponents-core"; let DateTimeValueFormatter = /*@__PURE__*/ (() => { class DateTimeValueFormatter extends Base { constructor() { super(...arguments); this.a = 0; this.b = false; this.f = null; this.e = null; this.c = null; this.d = null; this.g = null; this.h = null; } l() { this.b = true; } k(a) { this.a = a; this.b = false; } i(a) { if (+a == +(dateMinValue())) { return ""; } let b = (Intl && Intl.DateTimeFormat); if (b) { let format_ = null; switch (this.a) { case 1: if (this.c == null) { this.c = (new Intl.DateTimeFormat([], { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' })); } format_ = this.c; break; case 0: if (this.d == null) { this.d = (new Intl.DateTimeFormat([], { month: 'numeric', day: 'numeric', year: 'numeric' })); } format_ = this.d; break; } let date_ = a; return (format_.format(date_)); } else { let date_ = a; switch (this.a) { case 1: return (date_.toLocaleDateString()); case 0: return (date_.toLocaleDateString()); } return a.toString(); } } j() { let a = (Intl && Intl.DateTimeFormat); if (a) { let format_ = null; switch (this.a) { case 1: if (this.c == null) { this.c = (new Intl.DateTimeFormat([], { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' })); } format_ = this.c; break; case 0: if (this.d == null) { this.d = (new Intl.DateTimeFormat([], { month: 'numeric', day: 'numeric', year: 'numeric' })); } format_ = this.d; break; } let b = (format_.formatToParts(new Date())); let c = ""; for (let d = 0; d < b.length; d++) { switch ((b[d].type)) { case "day": c += "d"; break; case "month": c += "m"; break; case "year": c += "yyyy"; break; default: c += (b[d].value); break; } } return c; } return "m/d/yyyy"; } } DateTimeValueFormatter.$t = /*@__PURE__*/ markType(DateTimeValueFormatter, 'DateTimeValueFormatter'); return DateTimeValueFormatter; })(); export { DateTimeValueFormatter };