Code Monkey home page Code Monkey logo

Comments (9)

jefbarn avatar jefbarn commented on June 2, 2024 1

Verified [email protected] is working with timezone: 'America/Anchorage'
Thanks!

from croner.

victorird avatar victorird commented on June 2, 2024 1

@victorird Oh, thanks for reporting this! Released a potential hot fix in [email protected] (channel croner@legacy-node-support), where i added the following code as a quick workaround for AKDT and AKST not being supported by Date.parse():

	// Convert non-supported timezones
	// - Hotfix for AKST and AKDT 7.0-branch of Croner, fixed for real in 8.0
	tz = tz.replace("AKST","-0900").replace("AKDT","-0800");

Hacky, but i hope it should do for those who cannot go to 8.x. Please let me know if this works for you, and i'll release 7.0.6 stable.

Thanks for the quick hot fix. I tested it and it's working flawlessly!

from croner.

Hexagon avatar Hexagon commented on June 2, 2024

Interersting, can confirm this happens with multiple timezones resolving to AKDT.

from croner.

Hexagon avatar Hexagon commented on June 2, 2024

@jefbarn Please check if upgrading to [email protected] resolves this issue.

from croner.

Hexagon avatar Hexagon commented on June 2, 2024

Released in stable channel through 8.0.0

from croner.

victorird avatar victorird commented on June 2, 2024

Thanks for the fix @Hexagon . However I tried the 7.0.6-dev.0 branch with Node.js 16 and it throws the following error:

RangeError: Value shortOffset out of range for Date.prototype.toLocaleString options property timeZoneName
    at Date.toLocaleString (<anonymous>)
    at getTimezoneOffset (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:1284)
    at Function.minitz.fromTZ (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:359)
    at minitz (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:75)
    at CronDate.getDate (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:17226)
    at CronDate.getTime (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:17361)
    at Cron.msToNext (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:20340)
    at Cron.schedule (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:20975)
    at new Cron (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:19159)
    at Cron (/home/vagrant/projects/itheia-app/api/node_modules/croner/dist/croner.min.cjs:1:17825)

I'm guessing the syntax in 7.0.6-dev.0 is only supported for Node.js >= 18. We're unable to move to Node.js 18 at the moment due to hardware vendor limitation. Is there any chance you can make this bugfix work with Node.js 16? Thx again.

from croner.

Hexagon avatar Hexagon commented on June 2, 2024

@victorird Oh, thanks for reporting this! Released a potential hot fix in [email protected] (channel croner@legacy-node-support), where i added the following code as a quick workaround for AKDT and AKST not being supported by Date.parse():

	// Convert non-supported timezones
	// - Hotfix for AKST and AKDT 7.0-branch of Croner, fixed for real in 8.0
	tz = tz.replace("AKST","-0900").replace("AKDT","-0800");

Hacky, but i hope it should do for those who cannot go to 8.x. Please let me know if this works for you, and i'll release 7.0.6 stable.

from croner.

Hexagon avatar Hexagon commented on June 2, 2024

Nice! Added support for AST and released [email protected], will let this version linger for a while before releasing the stable version.

from croner.

Hexagon avatar Hexagon commented on June 2, 2024

Resolved in the 7.x branch through 7.0.7

from croner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.