PoskOfficial / Nepali-calendar-web

A PWA for minimal Nepali Calendar
https://miti.bikram.io/
BSD 2-Clause "Simplified" License
86 stars 22 forks source link

Day Calculation One Day Faster in Asia/Kathmandu Time Zone #58

Closed pandeysubash404 closed 1 year ago

pandeysubash404 commented 1 year ago

Issue Description:

The current implementation of day calculation in the Asia/Kathmandu time zone is resulting in events being displayed one day ahead of their actual date. This issue affects users who are using the Nepali calendar or are located in the Kathmandu time zone.

Steps to Reproduce:

  1. Create an event in the Miti calendar application with a specific date (e.g., July 20, 2023) using the Nepali calendar or while in the Asia/Kathmandu time zone.
  2. Save the event and verify its date in the Miti calendar.

Expected Behavior:

The event should be displayed on the correct date, matching the date accordingly in the Nepali calendar or the local Asia/Kathmandu time zone.

Actual Behavior:

The event is displayed one day ahead of the entered date. For example, today is July 20,2023 but it will label as yesterday .

Additional Information:

Proposed Solution:

The issue seems to be related to the day calculation logic used when displaying events in the Asia/Kathmandu time zone or using the Nepali calendar. To resolve this problem, the day calculation algorithm needs to be thoroughly reviewed and adjusted to ensure accurate date representation for events in the affected time zone.

One possible approach to investigate is to verify if there are any discrepancies in the conversion between the Gregorian and Nepali calendars within the Miti codebase. Additionally, it may be necessary to consider potential issues related to time zone offset calculations and DST (Daylight Saving Time) adjustments.

Attachments:

Miti1

Best regards, Subash Pandey pandeysubash404@gmail.com 2023, July 21

Parajulibkrm commented 1 year ago

Acknowledged. Please take a look into this @headshigh

Parajulibkrm commented 1 year ago

@pandeysubash404 Would you like to open a PR for this issue?

pandeysubash404 commented 1 year ago

@pandeysubash404 Would you like to open a PR for this issue? @Parajulibkrm Yes, I'd be happy to open a PR for this issue!

Additionally, I want to display today's date on the Events. Even if there are no events on a particular day, displaying today's date will help avoid confusion when comparing event days. I'll make sure to implement this improvement in the PR.

Parajulibkrm commented 1 year ago

I'm not sure if I understand what you mean there, could you elaborate a little about displaying "today's date"? Also, please go ahead with the PR.

pandeysubash404 commented 1 year ago

I'm not sure if I understand what you mean there, could you elaborate a little about displaying "today's date"? Also, please go ahead with the PR.

Hope with the help of below image , you can understand what i want to make change. The below image is after making the change, which (2023 July 21 , Friday) do not have any event but also being displayed. I think it will help to avoid confusion when comparing event days.

For Event Page :

Miti3

For Home Page :

Miti4
Parajulibkrm commented 1 year ago

Sure go ahead.

pandeysubash404 commented 1 year ago

Hi @Parajulibkrm ,

I wanted to let you know that I have successfully submitted my contribution to solve the issue (#58) regarding the event display one day ahead of the entered date. I have created a pull request (PR) with my changes on the branch "event-display". Please review the changes whenever you get a chance.

Additionally, I have taken into consideration the suggestion you made about displaying today's date even if there is no event occurring. This would help avoid confusion while comparing event days.

If there's anything else you'd like me to do or any further improvements you'd like to see, please let me know. I'm looking forward to your feedback.

Best regards, @pandeysubash404