kBashar / workingdaysbd

An app to calculate the date after n working days.
https://kbashar.github.io/workingdaysbd/
0 stars 0 forks source link

Add country selection #3

Open kBashar opened 6 months ago

kBashar commented 6 months ago

We only consider Bangladesh for public holiday, we will consider other countries.

  1. Japan
  2. US
  3. Bangladesh

Idea

Holidays.json file will not change much, maybe once or twice in a year. and if there is any mistake in the file then might change, which is rare.

Another thing. my present calculator only works for Bangladesh as the holidays are for Bangladesh only. But I will add support for other countries too. So, then, there will be other files like holidays_usa.json.

Again, this files won't change much.

To avoid fetching files everytime the extension is used, I will use some kind of versioning.

lets say, I will maintain a version file named versions.json

{
"holiday_bd": "2024_1",
"holiday_us": "2024_2"
}

local version will store the version number and every once in while will check if the version has changed, if changed, it will fetch the corresponding holiday file.

We might use AWS S3 with cloudfront

kBashar commented 6 months ago

At the start of the application we check for existence of the default public holiday files existence in local storage. If found we do nothing. If not found we fetch it from remote location URL. We add the version of the file in version settings.