spencermountain / spacetime

A lightweight javascript timezone library
http://spacetime.how/
Other
3.97k stars 184 forks source link

Support for Asia/Famagusta (DayLight plugin) #364

Closed Alvaro948 closed 1 year ago

Alvaro948 commented 1 year ago

Hi, I guess there is no support for Asia/Famagusta (northern part of cyprus) timezone:

const date = spacetime.now('Asia/Famagusta');
const result = date.daylight();

const dawn = result?.dawn; // NaN:NaNam
const sunset = result?.sunset; // NaN:NaNam

Same code for other timezones does work

Thanks!

spencermountain commented 1 year ago

hey Alvaro - good catch. looks like it's missing from this file in the geo plugin. That would be the quick fix for this.

we should really fallback more gracefully though. NaNs should definetly never appear.

i've got a busy week - but PRs welcomed. here's the issue, for reference

let s = spacetime.today('America/Havana')
console.log(s.point())

s = spacetime.today('Asia/Famagusta')
console.log(s.point())

cheers