{"version":3,"file":"formatDateTime.chunk-B-Nl6quR.js","sources":["../../Navigation/NavIcons.vue","../../shared/utils/formatDateTime.ts"],"sourcesContent":["\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","const dateOptions: {\r\n [key: string]: string;\r\n} = {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric',\r\n};\r\n\r\nconst dateTimeOptions: {\r\n [key: string]: string;\r\n} = {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric',\r\n hour: 'numeric',\r\n minute: 'numeric', // ,\r\n // second: 'numeric'\r\n};\r\n\r\nexport const formatDate = (date: string | Date | null | undefined, options: Intl.DateTimeFormatOptions = dateOptions) => {\r\n if (date == null) return '';\r\n\r\n let local = viewModel.CurrentUser() ? viewModel.CurrentUser().Language.Culture() : navigator.language;\r\n\r\n if (local.startsWith('ks')) local = 'en-US';\r\n\r\n return new Intl.DateTimeFormat(local, options).format(new Date(date));\r\n};\r\n\r\nexport const formatDateTime = (date: string | Date | null | undefined, options: Intl.DateTimeFormatOptions = dateTimeOptions) => {\r\n if (date == null) return '';\r\n\r\n let local = viewModel.CurrentUser() ? viewModel.CurrentUser().Language.Culture() : navigator.language;\r\n\r\n if (local.startsWith('ks')) local = 'en-US';\r\n\r\n let dateObj = new Date(date);\r\n\r\n if (!isValidDate(dateObj)) return date;\r\n\r\n return new Intl.DateTimeFormat(local, options).format(new Date(date));\r\n};\r\n\r\nexport function isValidDate(d: any) {\r\n return d instanceof Date && !isNaN(d as any);\r\n}\r\n"],"names":["props","__props","dateOptions","dateTimeOptions","formatDate","date","options","local","formatDateTime","dateObj","isValidDate","d"],"mappings":"yzCA6BI,MAAMA,EAAQC,uhYC7BZC,EAEF,CACA,KAAM,UACN,MAAO,UACP,IAAK,SACT,EAEMC,EAEF,CACA,KAAM,UACN,MAAO,UACP,IAAK,UACL,KAAM,UACN,OAAQ,SAEZ,EAEaC,EAAa,CAACC,EAAwCC,EAAsCJ,IAAgB,CACjH,GAAAG,GAAQ,KAAa,MAAA,GAErB,IAAAE,EAAQ,UAAU,YAAA,EAAgB,UAAU,YAAc,EAAA,SAAS,UAAY,UAAU,SAE7F,OAAIA,EAAM,WAAW,IAAI,IAAWA,EAAA,SAE7B,IAAI,KAAK,eAAeA,EAAOD,CAAO,EAAE,OAAO,IAAI,KAAKD,CAAI,CAAC,CACxE,EAEaG,EAAiB,CAACH,EAAwCC,EAAsCH,IAAoB,CACzH,GAAAE,GAAQ,KAAa,MAAA,GAErB,IAAAE,EAAQ,UAAU,YAAA,EAAgB,UAAU,YAAc,EAAA,SAAS,UAAY,UAAU,SAEzFA,EAAM,WAAW,IAAI,IAAWA,EAAA,SAEhC,IAAAE,EAAU,IAAI,KAAKJ,CAAI,EAE3B,OAAKK,EAAYD,CAAO,EAEjB,IAAI,KAAK,eAAeF,EAAOD,CAAO,EAAE,OAAO,IAAI,KAAKD,CAAI,CAAC,EAFlCA,CAGtC,EAEO,SAASK,EAAYC,EAAQ,CAChC,OAAOA,aAAa,MAAQ,CAAC,MAAMA,CAAQ,CAC/C"}