andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.53k stars 306 forks source link

Date.advance() does not work with parts-of-an-hour #549

Closed Earl-Brown closed 7 years ago

Earl-Brown commented 8 years ago

Date.[advance,create]("2.25 hours") doesn't work.

Sure, I could Date.create().advance("2 hours").advance("15 minutes") - but that makes it REALLY difficult for a manually edited JSON configuration.

[Date.advance, Date.create]("2 hours from now") works just fine. So I suspect any translation from relative that includes partials doesn't work correctly.

andrewplummer commented 8 years ago

OK you got it buddy.

This is going to be some kind of record... I'm literally deploying everything as we speak. Just managed to squeeze this through.

Earl-Brown commented 8 years ago

Awesome! Thanks!

What's the best way to integrate this into my existing app?

andrewplummer commented 8 years ago

What version are you using?

vendethiel commented 8 years ago

(hijacking this thread to say congrats :-).)

andrewplummer commented 8 years ago

Thanks man! It's going to be..................big....

Earl-Brown commented 8 years ago

I think I'm on 1.4.1

andrewplummer commented 8 years ago

Ok well in that case I may have to take everything back. It will go into 2.0.0 but I actually already deployed 1.5.0 just a few hours ago. 2.0.0 has a lot of breaking changes and on the assumption that it's non-trivial for you to upgrade, then this will have to be back-ported into 1.5.1.

It won't take long, but probably no records :)

Earl-Brown commented 8 years ago

OK...I appreciate it!

I look forward to using 2.0 - but I'm scared to jump into it right now and miss updating something.

andrewplummer commented 8 years ago

Yeah, that's fair. Maybe you'd like to test out the new upgrade script. Kinda need someone to beta test it. The link is here:

https://sugarjs.com/upgrading

It'll be live..........soon....

Earl-Brown commented 8 years ago

I'll give it a go. Doing backups now :)

andrewplummer commented 8 years ago

Aaaaaaand it's live!

Earl-Brown commented 8 years ago

Cool...

Looks like the change for "advance()" didn't make it into the docs, tho...testing it on the docs page shows current time instead of advanced time.

But the upgrade to 2.0 wasn't that painful at all...so far..I hope I haven't missed anything!

And .advance() is working for me there.

vendethiel commented 8 years ago

\o/ 2013 me believed in it all along :-). Amazing!

andrewplummer commented 8 years ago

@Earl-Brown Forgot to push the build! Advance should work on the docs page now, but might have to clear some caches.

andrewplummer commented 8 years ago

@vendethiel My god 2013.... unbelievable... :D

vendethiel commented 8 years ago

Oh, yeah, I have all sorts of way of making me feel old. I was in high school back then.

Earl-Brown commented 8 years ago

@vendethiel ... how cute. My kids were in high school back then :)

andrewplummer commented 8 years ago

@Earl-Brown THANK YOU :D

Earl-Brown commented 8 years ago

Oh, no - thank YOU!!!

I love this library. One of the most useful I've come across.

Earl-Brown commented 8 years ago

How can I give more immediate feedback on issues as they come up? I'd rather not clutter the "issues" list with something just rolled out...

andrewplummer commented 7 years ago

Closing this for now. Feel free to raise new issues!