Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getSelectedOption (format, locale, timezone, value) {
if (!value) {
return
}
return {
value: value,
label: DateTime.parse(value, locale, timezone).format(format)
}
}
_parseDate (dateStr, locale, timezone) {
return DateTime.parse(dateStr, locale, timezone)
}
getBaseDateForRendering (defaultValue, locale, timezone, value) {
let baseDate
const baseValue = value || defaultValue
if (baseValue) {
baseDate = DateTime.parse(baseValue, locale, timezone)
} else {
baseDate = DateTime.now(locale, timezone)
}
return baseDate.second(0).millisecond(0)
}
_parseDate (dateStr, locale, timezone) {
return DateTime.parse(dateStr, locale, timezone)
}