Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Dates should be localized (glossary author) #86

@planetf1

Description

@planetf1
Member

When using the 'glossary author' UI there are Advanced options to set effectivity from/to dates

However these render in US mm/dd/yyyy format despite browser being configured in UK format

The page should use appropriate localization techniques to render the date in the appropriate format

My browser (chrome) currently offers an Accept-Language header of

en-GB,en-US;q=0.9,en;q=0.8

Though the exact algorithm to use may require research.

Screenshot 2021-02-10 at 12 35 43

Activity

davidradl

davidradl commented on Feb 11, 2021

@davidradl
Member

We use the carbon datepicker https://www.carbondesignsystem.com/components/date-picker/code. It looks like you can specify the date input form and default text. It would need a bit of investigation, to work out how to get these strings from the locale. Also this really needs to include time as well as date, but carbon did not have a time picker when I last looked.

planetf1

planetf1 commented on Feb 11, 2021

@planetf1
MemberAuthor

Both with date and time we'll have to be very clear how that date is used. Indeed should it be rendered in user's local time, or should we always use UTC? (which brings in the very notion of day boundaries). Clearly internally it's all UTC, I'm just meaning clarity on the UI for the user to know what to enter

github-actions

github-actions commented on Apr 13, 2021

@github-actions

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

davidradl

davidradl commented on May 13, 2021

@davidradl
Member

@planetf1 I have change the logic around dates and times for create in the new wizards. I have

  • changed the subject area APIs beans to use Longs for all dates
  • introduced a new DateTime Widget, for input - the date part has a date picker. The text can be overridden. There are hint text to the format if there is no text in the field. The pattern is also mentioned in the label.
  • On read I have installed date-fns for React - it has a standard user friendly way to display dates. It formats to something like "Friday, May 28th, 2021 at 12:00:00 AM GMT+01:00". This date package does have localisation capability.
planetf1

planetf1 commented on May 13, 2021

@planetf1
MemberAuthor

Thanks @davidradl .

  • For longs, I presume this is milliseconds since Jan 1 1970 UTC+1 in Java, so by 'date' it really is a fully speced date/time (in english speak) so not necessarily on a calendar date boundary (when converted to local time?) Which is as It should be imo
  • When entering time in the widget, is the timezone or current time clear - I wonder if the user needs to understand what the zone and/or time is? (I can't see the code or ui just yet of course)
  • for reading that format is clear, though I would have expected to see UTC rather than GMT (which is technically incorrectly used IMO), but I guess that may depend on current timezone/locale settings (from browser?)
github-actions

github-actions commented on Jul 13, 2021

@github-actions

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

davidradl

davidradl commented on Aug 4, 2021

@davidradl
Member

@planetf1 From your response, I think your outstanding concern is what it looks like on write. Here is a screen shot for effectivity time input. It show a placeholder with UTC greyed out. I hope this also addresses your first point about datetimes.

Screenshot 2021-08-04 at 15 12 18

davidradl

davidradl commented on Aug 4, 2021

@davidradl
Member

you also say "On read I have installed date-fns for React - it has a standard user friendly way to display dates. It formats to something like "Friday, May 28th, 2021 at 12:00:00 AM GMT+01:00". This date package does have localisation capability."

The code uses https://date-fns.org/v2.23.0/docs/format . With PPPPpppp. This is the standard long localised date and time using the standard library - this seems reasonable to me.

planetf1

planetf1 commented on Sep 27, 2021

@planetf1
MemberAuthor

The UTC reference looks good, but note that the date is in mm/dd/yyyy format, which is US format.
The browser locale is set to en_GB so I would expect the date to be in dd/mm/yyyy format - or indeed ISO format if we want to have a single interational format

github-actions

github-actions commented on Nov 27, 2021

@github-actions

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

20 remaining items

davidradl

davidradl commented on Oct 26, 2022

@davidradl
Member

@sarbull I think there are 2 ways Egeria APIs do this. The files is to send a UTC Date object. I thought it simpler to send the long value to the React Ui code, so I sent the milliseconds since epoch - so I change the View APIs to send the long . Ideally we would pick up the locale from the browser and use that for the dates and also the labels that includes the patterns, currently the patterns are hard coded, as I could not see an obvious way to programmatically get them at the time.

davidradl

davidradl commented on Oct 26, 2022

@davidradl
Member

In time we could pick the locale from a user profile and expose it as a user preference. I think picking up the browser locale is a natural next step.

sarbull

sarbull commented on Oct 26, 2022

@sarbull
Member

i believe using timestamp would be the way to do it for the UI, like unix epoch time yes, https://www.epochconverter.com/ but we need to have the APIs be sending us timestamps instead of any random date format that was used

davidradl

davidradl commented on Oct 26, 2022

@davidradl
Member

which APIs are you seeing that use a random date format ?

github-actions

github-actions commented on Dec 26, 2022

@github-actions

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

github-actions

github-actions commented on Mar 5, 2023

@github-actions

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

github-actions

github-actions commented on May 8, 2023

@github-actions

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sarbull@planetf1@davidradl

        Issue actions

          Dates should be localized (glossary author) · Issue #86 · odpi/egeria-react-ui