azza-bazoo / prettycron

Display cron runspecs in human-readable format
GNU Lesser General Public License v3.0
122 stars 62 forks source link

Cannot read property 'ordinal' of undefined #9

Closed jose-doopex closed 9 years ago

jose-doopex commented 9 years ago

Hi,

I'm getting a very strange issue.

If I use prettyCron.toString( "0 * * * *"), everything is fine and I get "Every hour, on the hour"

If I use prettyCron.toString( "15 * * * *"), I'm expecting something like "Every hour, on the minute 15", but I get this error in the javascript console:

TypeError: Cannot read property 'ordinal' of undefined at numberList (prettycron.js:38:30)

Could you help? Thanks !!!

azza-bazoo commented 9 years ago

What version of moment.js are you using? I had to change that line due to changes in moment, so I suspect it'll work if you upgrade to the latest version.

(Perhaps the fix is to throw a warning if moment.version is too old.)

jose-doopex commented 9 years ago

I have updated moment and it works. Thanks!!!