time_difference icon indicating copy to clipboard operation
time_difference copied to clipboard

suport rails 6

Open alfie-max opened this issue 5 years ago • 4 comments

alfie-max avatar Aug 13 '20 09:08 alfie-max

Any news on this? Would be very helpful @tmlee :)

swelther avatar Oct 13 '20 11:10 swelther

Any news on this? Would be very helpful @tmlee :)

I've switched to https://github.com/excpt/moments with some contributions (improvements) to it (already merged), so I can recommend it. It doesn't have activesupport dependency at all.

AlexWayfer avatar Oct 15 '20 16:10 AlexWayfer

Any news on this? Would be very helpful @tmlee :)

I've switched to https://github.com/excpt/moments with some contributions (improvements) to it (already merged), so I can recommend it. It doesn't have activesupport dependency at all.

Thank you, that could be indeed a good alternative for us :)

swelther avatar Oct 16 '20 05:10 swelther

Just a heads up, I did a quick comparison between TimeDifference and Moments to ensure similar results but I couldn't get fractional values from Moments:

irb(main):001:0> t1 = 14.days.ago
=> Thu, 04 Aug 2022 15:52:25 MDT -06:00
irb(main):002:0> t2 = Time.zone.now
=> Thu, 18 Aug 2022 15:52:31 MDT -06:00
irb(main):004:0> TimeDifference.between( t1, t2 ).in_minutes
=> 20160.09

irb(main):008:0> Moments.difference( t1, t2 ).in_minutes
=> 20160

Again, maybe there is a setting to preserve this kind of precision but I couldn't find it. Just be aware. I think I'll try a fork of this library as a quick fix for now.

joshuapinter avatar Aug 18 '22 21:08 joshuapinter