cylc-ui icon indicating copy to clipboard operation
cylc-ui copied to clipboard

Option to represent date-times in long ISO format

Open MetRonnie opened this issue 3 years ago • 6 comments

Describe exactly what you would like to see in an upcoming release

We should consider displaying date-times in the long ISO format in the UI, even if the cycle point format of a workflow is the short format, as it will make cycle points easier to read. I.e. 2000-01-01T00:00Z instead of 20000101T0000Z.

This could be an option in settings.

Pull requests welcome!

MetRonnie avatar Mar 07 '22 11:03 MetRonnie

Agreed, that would be nice. Although it might be a little dangerous, if it leads users to use the wrong datetime format on the command line? (maybe we can automatically convert to the workflow format... I think we do that already for cylc suite-state xtriggers).

hjoliver avatar Mar 07 '22 21:03 hjoliver

I don't think it matters what users use on the command line? According to the docs

The time zone you specify here will be used only for writing/dumping cycle points

MetRonnie avatar Mar 08 '22 10:03 MetRonnie

I don't think it matters what users use on the command line? According to the docs

The time zone you specify here will be used only for writing/dumping cycle points

I mean the whole datetime format, not just the timezone.

E.g. for a monthly-cycling workflow with this:

cycle point format = %Y-%m

The CLI has to use the same format as the scheduler because no conversion is done. If wf//2025-01/foo is running:

$ cylc kill wf//2025-01/foo  # OK
$ cylc kill wf//202501/foo  # ERROR (task not found)

hjoliver avatar Mar 08 '22 22:03 hjoliver

Argh, clearly I needed more coffee yesterday ☕

MetRonnie avatar Mar 09 '22 09:03 MetRonnie

Since https://github.com/cylc/cylc-flow/pull/4881 the CLI no longer has to be given the same format as the workflow cycle point format

MetRonnie avatar May 23 '22 09:05 MetRonnie

Just had a thought about this the other day. Potentially we could do a similar thing to i18n and have a function we call on every cycle point displayed in all vue templates, like https://github.com/cylc/cylc-ui/blob/afb15003f26fa3e11225a828da06cf28a3219d6a/src/components/cylc/workspace/Toolbar.vue#L155-L157

Maybe something like

<span>{{ $c(node.cycle) }}</span>
const displayLongCyclePoints: Boolean = useLocalStorage(...)

function $c (cycle: string) {
  return displayLongCyclePoints ? formatLong(cycle) : cycle
}

MetRonnie avatar Jun 20 '25 10:06 MetRonnie