pinkary-project / pinkary.com

Create a landing page for all your links and connect with like-minded people without the noise.
https://pinkary.com
GNU Affero General Public License v3.0
1.31k stars 330 forks source link

Asia/Katmandu is not a valid timezone #603

Open Summonshr opened 2 months ago

Summonshr commented 2 months ago

I am from nepal. Somehow, the timezone used is Asia/Katmandu but in server we have Asia/Kathmandu. I am not sure what to do about. Fix in front-end or back-end. The Intl.DateTimeFormat().resolvedOptions().timeZone api used gives 'Asia/Katmandu' which is not right as per server valid timezones.

image

pratikkuikel commented 2 months ago

@Summonshr This is actually not an issue with this project or the php. Php recognizes Asia/Kathmandu as timezone and not Asia/Katmandu resulting in invalid timezone.

It's actually an issue of IANA. https://github.com/moment/moment-timezone/issues/754 https://github.com/moment/moment-timezone/issues/159 https://www.iana.org/time-zones

I have verified that the current timezone database of IANA has Asia/Kathmandu. This could be due to current nodejs running in your or my system not having latest timezone db updates. IDK

Current workaround could be adding this to the file layouts/app.blade.php before sending post request to the server.

if (timezone === 'Asia/Katmandu') {
    timezone = 'Asia/Kathmandu';
}