Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Introduction

In scope of modular implementation in Nepal support for secondary calendar was added. While previous solution allowed to replace one calendar with the other, new solution allows user to easily switch between Gregorian calendar and second calendar of choice.

...

General information and settings

In scope of modular implementation in Nepal support for secondary calendar was added. While previous solution allowed to replace one calendar with the other, new solution allows user to easily switch between Gregorian calendar and second calendar of choice.

Enabled with setting:

Code Block
- `calendarSwitch`: enable calendar switcher toggle on the navbar of the webpage.  Default false.

Pickers (front-end)

Currently used component for secondary calendar is react-multi-date-picker. It was picked by us to support for many calendars (Indian, Persian, Gregorian, Arabic) and a lot of customizable options as well as ongoing support by developers.

...


If you need support for calendar not defined here, you can create one yourself (provided it is 12 months long, other calendars are not yet supported by this picker) using this guide. Additionally nepali calendar files can be used as a reference (files in calendars directory).

To calculate epoch value, the following code was used (although I had to add around 500 manually):

Code Block
languagejs
    import { DateObject } from "react-multi-date-picker";
    const julianDay = new DateObject().toJulianDay();
    const days = new DateObject().add(56, "years").add(8, "months").add(17, "days").toDays();
    console.log(new DateObject().add(56, "years").add(8, "months").add(17, "days").toDate());
    const epoch = julianDay - days


After adding those files and adding them to relevant dictionaries in the code, you need to specify following settings for your calendar to be used:

Code Block
- `secondCalendarType`: type of secondary calendar picker (if enabled), default "nepali"
- `secondCalendarLocale`: locale for secondary calendar picker (if enabled), default "nepali_en"

Display (front-end)

In scope of modular implementation in Nepal support for secondary calendar was added. While previous solution allowed to replace one calendar with the other, new solution allows user to easily switch between Gregorian calendar and second calendar of choice.

Product cycles (back-end)

In scope of modular implementation in Nepal support for secondary calendar was added. While previous solution allowed to replace one calendar with the other, new solution allows user to easily switch between Gregorian calendar and second calendar of choice.

Reports (back-end)

To be implemented - currently during creation of a report user can choose desired calendar type, but reports are generated with Gregorian dates only.