You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Case Prerequisite: The system must be running in a different timezone (e.g., UTC).
When the system is in a different timezone, handling dates and times specific to Nepal's timezone (Asia/Kathmandu) can be challenging. For instance, if we have a date/time string in Nepal's timezone, there is no direct way to retrieve Nepal-specific values like the year, month, day, hour, or minutes. Instead, it always returns data in the system's timezone data.
Thanks to the NepaliDate class, from which this can be achieved. However, introducing this feature could also benefit the NepaliDate class by improving logic decoupling. Additionally, not every use case requires converting the date to the Nepali calendar.
Proposed Solution
Create a NepalTimezoneDate class that extends JavaScript's Date object. The NepalTimezoneDate object would behave exactly like a Date object operating on Asia/Kathmandu timezone.
Use Case
Prerequisite: The system must be running in a different timezone (e.g., UTC).
When the system is in a different timezone, handling dates and times specific to Nepal's timezone (Asia/Kathmandu) can be challenging. For instance, if we have a date/time string in Nepal's timezone, there is no direct way to retrieve Nepal-specific values like the year, month, day, hour, or minutes. Instead, it always returns data in the system's timezone data.
Thanks to the
NepaliDate
class, from which this can be achieved. However, introducing this feature could also benefit theNepaliDate
class by improving logic decoupling. Additionally, not every use case requires converting the date to the Nepali calendar.Proposed Solution
Create a
NepalTimezoneDate
class that extends JavaScript'sDate
object. TheNepalTimezoneDate
object would behave exactly like aDate
object operating on Asia/Kathmandu timezone.Example Usage:
Alternatives Considered
N/A
Dependencies
N/A
Additional Context
The logic implemented in
NepaliDate
are insrc/utils.ts
>getNepalDateAndTime
andgetDate
The text was updated successfully, but these errors were encountered: