Skip to content

FIREFLY-1824: Allow option for Job's date/time to be displayed in local timezone.#1865

Merged
loitly merged 1 commit intodevfrom
FIREFLY-1824-bgmonitor-timezone
Oct 20, 2025
Merged

FIREFLY-1824: Allow option for Job's date/time to be displayed in local timezone.#1865
loitly merged 1 commit intodevfrom
FIREFLY-1824-bgmonitor-timezone

Conversation

@loitly
Copy link
Contributor

@loitly loitly commented Oct 16, 2025

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/

  • Go to Job Monitor.
  • If no job history exists, create a new job.
  • Toggle between UTC and Local Time. Verify that all date/time values in the Job History table update accordingly.
  • Open Job Details. Confirm that date/time fields there also reflect the selected timezone.

@loitly loitly added this to the 2025.5 milestone Oct 16, 2025
@loitly loitly self-assigned this Oct 16, 2025
@loitly loitly requested a review from robyww October 16, 2025 16:20
Copy link
Contributor

@robyww robyww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lrebull I don’t have a strong preference here. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lrebull
Copy link
Contributor

lrebull commented Oct 16, 2025

Looks really nice! it all seems to work as described.

@lrebull
Copy link
Contributor

lrebull commented Oct 16, 2025

FYI (and i think this is peripheral to your ticket?) i can't load spectrophotometry results -- i get this. Kartik metnioned the other day that this was fixed in his pr, but that doesn't help me for showing results.
Screenshot 2025-10-16 at 9 35 33 AM

@loitly loitly merged commit d981ab7 into dev Oct 20, 2025
@loitly loitly deleted the FIREFLY-1824-bgmonitor-timezone branch October 20, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants