dhis2 / notes

:memo: Memos, proposals, agendas and meeting minutes
19 stars 8 forks source link

Dates and periods in a multi-calendar environment #51

Open HendrikThePendric opened 5 years ago

HendrikThePendric commented 5 years ago

Context

On Wednesday, June 12th 2019 a meeting took place to discuss how we are currently working with dates and periods in DHIS2 and ways to improve this. The main reason for organising the meeting was the fact that the current implementation in the front-end is fragmented and incomplete.

Several people were present:

Current situation

Problem analysis

Proposed approach

HendrikThePendric commented 5 years ago

@larshelge Could you please give your opinion about the proposed approach? Do you see this as a way forward, or do you think we should have a fully client-side implementation of several calendars too?

varl commented 5 years ago

Related: https://github.com/dhis2/d2-ui/pull/428

abyot commented 5 years ago

I had a meeting with @larshelge last week. He is more inclined to have a common JS library and we agreed to tackle this from two angles:

  1. period library without a datepicker component in it and
  2. datepicker component

I will be looking into 1 - pure period library. For this I am wondering if we can build on Int.DateTimeFormat ?

Latest browser's are coming with Internationalization API support and we should be able to capitalize on that. Do we have list of browser versions that we support and do not support?

ismay commented 5 years ago

@abyot I was wondering if there are any existing solutions out there that we can leverage, or build on for 1. Do you know of any? I can imagine it'd be nice to contribute to something existing if possible.

abyot commented 5 years ago

@ismay not really much. I am thinking of building on Int.DateTimeFormat and probably Luxon for manipulating date and times which we need for generating periods.

HendrikThePendric commented 5 years ago

@abyot so, just to confirm: we'll need to build these components with full support for all calendar systems, including Nepalese, etc?

abyot commented 5 years ago

yes, will have to support all the calendars out there.

I know Int.DateTimeFormat does not have support to Nepalese. I don't know may be because Nepalese calendar works with a mapping table than a generic algorithm? ... still better to build on native browser and probably fill the missing ones ourselves.

HendrikThePendric commented 5 years ago

still better to build on native browser and probably fill the missing ones ourselves.

Yeah quite likely. It's something I'd really have to dive into a bit to make any suggestions.

I did a tiny little bit of research into this and while I couldn't find any Date pickers, or date utility libs, with direct support for Nepalese, I did find some converters for various calendars incl. Nepalese. Perhaps we could utilise base our solution around Int.DateTimeFormat + one of these converters....