mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
197 KiB
JSON
1 line
197 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from './index-7a8b7a1c.js';\nimport { b as getIonMode } from './ionic-global-63a97a32.js';\nimport { a as addEventListener, k as clamp, j as findItemLabel, e as renderHiddenInput } from './helpers-1457892a.js';\nimport { p as pickerController, B as BACKDROP, i as isCancel, e as prepareOverlay, d as present, f as dismiss, g as eventMethod, s as safeCall } from './overlays-a62f858b.js';\nimport { h as hostContext, g as getClassMap } from './theme-ff3fc52f.js';\nimport { c as createAnimation } from './animation-822d986b.js';\nimport { b as hapticSelectionChanged, h as hapticSelectionEnd, a as hapticSelectionStart } from './haptic-27b3f981.js';\nimport './hardware-back-button-4a6b37fb.js';\n\n/**\n * Gets a date value given a format\n * Defaults to the current date if\n * no date given\n */\nconst getDateValue = (date, format) => {\n const getValue = getValueFromFormat(date, format);\n if (getValue !== undefined) {\n if (format === FORMAT_A || format === FORMAT_a) {\n date.ampm = getValue;\n }\n return getValue;\n }\n const defaultDate = parseDate(new Date().toISOString());\n return getValueFromFormat(defaultDate, format);\n};\nconst renderDatetime = (template, value, locale) => {\n if (value === undefined) {\n return undefined;\n }\n const tokens = [];\n let hasText = false;\n FORMAT_KEYS.forEach((format, index) => {\n if (template.indexOf(format.f) > -1) {\n const token = '{' + index + '}';\n const text = renderTextFormat(format.f, value[format.k], value, locale);\n if (!hasText && text !== undefined && value[format.k] != null) {\n hasText = true;\n }\n tokens.push(token, text || '');\n template = template.replace(format.f, token);\n }\n });\n if (!hasText) {\n return undefined;\n }\n for (let i = 0; i < tokens.length; i += 2) {\n template = template.replace(tokens[i], tokens[i + 1]);\n }\n return template;\n};\nconst renderTextFormat = (format, value, date, locale) => {\n if (format === FORMAT_DDDD || format === FORMAT_DDD) {\n try {\n value = new Date(date.year, date.month - 1, date.day).getDay();\n if (format === FORMAT_DDDD) {\n return (locale.dayNames ? locale.dayNames : DAY_NAMES)[value];\n }\n return (locale.dayShortNames ? locale.dayShortNames : DAY_SHORT_NAMES)[value];\n } catch (e) {\n // ignore\n }\n return undefined;\n }\n if (format === FORMAT_A) {\n return date !== undefined && date.hour !== undefined ? date.hour < 12 ? 'AM' : 'PM' : value ? value.toUpperCase() : '';\n }\n if (format === FORMAT_a) {\n return date !== undefined && date.hour !== undefined ? date.hour < 12 ? 'am' : 'pm' : value || '';\n }\n if (value == null) {\n return '';\n }\n if (format === FORMAT_YY || format === FORMAT_MM || format === FORMAT_DD || format === FORMAT_HH || format === FORMAT_mm || format === FORMAT_ss) {\n return twoDigit(value);\n }\n if (format === FORMAT_YYYY) {\n return fourDigit(value);\n }\n if (format === FORMAT_MMMM) {\n return (locale.monthNames ? locale.monthNames : MONTH_NAMES)[value - 1];\n }\n if (format === FORMAT_MMM) {\n return (locale.monthShortNames ? locale.monthShortNames : MONTH_SHORT_NAMES)[value - 1];\n }\n if (format === FORMAT_hh || format === FORMAT_h) {\n if (value === 0) {\n return '12';\n }\n if (value > 12) {\n value -= 12;\n }\n if (format === FORMAT_hh && value < 10) {\n return '0' + value;\n }\n }\n return value.toString();\n};\nconst dateValueRange = (format, min, max) => {\n const opts = [];\n if (format === FORMAT_YYYY || format === FORMAT_YY) {\n // year\n if (max.year === undefined || min.year === undefined) {\n throw new Error('min and max year is undefined');\n }\n for (let i = max.year; i >= min.year; i--) {\n opt
|