FIREFLY-1824: Allow option for Job's date/time to be displayed in local timezone.#1865
FIREFLY-1824: Allow option for Job's date/time to be displayed in local timezone.#1865
Conversation
robyww
left a comment
There was a problem hiding this comment.
It looks good. I suggested a couple of small changes.
|
|
||
| function JobMonitorTable({help_id, ...props}) { | ||
| const jobMap = useStoreConnector(() => getBackgroundInfo()?.jobs || {}); | ||
| const useLocalTime = useStoreConnector(() => getFieldVal(jobMonitorGroupKey, useLocalTimeKey)); |
There was a problem hiding this comment.
The better way to do this is.
const useLocalTime= useFieldGroupValue(useLocalTimeKey)[0]();Also you don't need to group key since it comes from the context so it is more reusable.
There was a problem hiding this comment.
This is not inside a FieldGroup. What will the groupKey be in this case?
I don't like useFieldGroupValue. Unless getFieldVal is removed or deprecated, I’ll keep using it. It’s simple and straightforward.
|
|
||
| export function LocalOrUTC() { | ||
| const parts = Intl.DateTimeFormat('en', { timeZoneName: 'short' }).formatToParts(new Date()); | ||
| const tzAbbr = parts.find((p) => p.type === 'timeZoneName').value; |
There was a problem hiding this comment.
I think it might be better to just say Local or Local Time here. I had to do a double take when looking at it.
There was a problem hiding this comment.
@lrebull I don’t have a strong preference here. What do you think?
There was a problem hiding this comment.
i would prefer that it told me what time zone it was working in. it's been the case that i've been sitting in eastern time but my laptop is on pacific time, for example.
|
Looks really nice! it all seems to work as described. |

Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1824
Add a toggle to switch between UTC and local timezone.
Update all job date/time fields to display according to the selected timezone.
Test: https://firefly-1824-bgmonitor-timezone.irsakubedev.ipac.caltech.edu/applications/spherex/