You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've noticed if changing the owner timezone to another country i.e. something like Australia, (in config.ts -> OWNER_TIMEZONE), I get an error:
error lib\availability\helpers.ts (68:20) @ toLocaleTimeString
error Error [RangeError]: Value longGeneric out of range for Date.prototype.toLocaleTimeString options property timeZoneName
at Date.toLocaleTimeString ()
I've noticed this problem goes away by removing the timezonename: "longGeneric" clause in request.ts interval to human string fx ->
'''
function intervalToHumanString({
start,
end,
timeZone,
}: DateTimeIntervalWithTimezone): string {
return ${formatLocalDate(start, { month: "long", day: "numeric", hour: "numeric", minute: "numeric", weekday: "long", timeZone, })} – ${formatLocalTime(end, { hour: "numeric", minute: "numeric", timeZone, timeZoneName: "longGeneric", })}
}
'''
when removing timezonename: "longGeneric" i no longer have this problem i.e.
'''
function intervalToHumanString({
start,
end,
timeZone,
}: DateTimeIntervalWithTimezone): string {
return `${formatLocalDate(start, {
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
weekday: "long",
timeZone,
})} – ${formatLocalTime(end, {
hour: "numeric",
minute: "numeric",
timeZone,
})}`
}
'''
The text was updated successfully, but these errors were encountered:
Sometimes (at least for some US timezones), the longGeneric response produced a more human-readable string. Sorry that my US-centricity gave you a headache, but appreciate you reporting the find. Will incorporate the fix. :-)
Hi, I've noticed if changing the owner timezone to another country i.e. something like Australia, (in config.ts -> OWNER_TIMEZONE), I get an error:
error lib\availability\helpers.ts (68:20) @ toLocaleTimeString
error Error [RangeError]: Value longGeneric out of range for Date.prototype.toLocaleTimeString options property timeZoneName
at Date.toLocaleTimeString ()
I've noticed this problem goes away by removing the timezonename: "longGeneric" clause in request.ts interval to human string fx ->
'''
function intervalToHumanString({
start,
end,
timeZone,
}: DateTimeIntervalWithTimezone): string {
return
${formatLocalDate(start, { month: "long", day: "numeric", hour: "numeric", minute: "numeric", weekday: "long", timeZone, })} – ${formatLocalTime(end, { hour: "numeric", minute: "numeric", timeZone, timeZoneName: "longGeneric", })}
}
'''
when removing timezonename: "longGeneric" i no longer have this problem i.e.
'''
function intervalToHumanString({
start,
end,
timeZone,
}: DateTimeIntervalWithTimezone): string {
return `${formatLocalDate(start, {
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
weekday: "long",
timeZone,
})} – ${formatLocalTime(end, {
hour: "numeric",
minute: "numeric",
timeZone,
})}`
}
'''
The text was updated successfully, but these errors were encountered: