Hello, I needed to do some date calculations in JS for a project I''m working on so I ported the numeric time extensions from Rails to JS. Now I can neat things like this: ((3).weeks() + (2).hours() + (15).minutes()).fromNow().toDate() Read more: http://burnfield.com/martin/2006/09/15/rails-time-extensions-ported-to-javascript Martin Ström -- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
That''s awesome! On 9/15/06, Martin Ström <martinstromlists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > I needed to do some date calculations in JS for a project I''m working on so > I ported the numeric time extensions from Rails to JS. Now I can neat things > like this: ((3).weeks() + (2).hours() + > (15).minutes()).fromNow().toDate() > > Read more: > http://burnfield.com/martin/2006/09/15/rails-time-extensions-ported-to-javascript > > > Martin Ström > -- > burnfield.com/martin > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Thomas Fuchs
2006-Sep-17 20:11 UTC
Re: [ANN] Rails'' numeric time extensions for JavaScript
Cool stuff. PDI adding a strftime method. :) -Thomas Am 15.09.2006 um 20:29 schrieb Martin Ström:> Hello, > I needed to do some date calculations in JS for a project I''m > working on so I ported the numeric time extensions from Rails to > JS. Now I can neat things like this: ((3).weeks() + (2).hours() + > (15).minutes()).fromNow().toDate() > > Read more: > http://burnfield.com/martin/2006/09/15/rails-time-extensions-ported- > to-javascript > > > Martin Ström > -- > burnfield.com/martin > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Ström
2006-Sep-17 22:13 UTC
Re: [ANN] Rails'' numeric time extensions for JavaScript
Good idea. Here is a JS-version I''ve used before that I could include (if its okay with the author) http://redhanded.hobix.com/inspect/showingPerfectTime.html Martin On 9/17/06, Thomas Fuchs <t.fuchs-moWQItti3gBl57MIdRCFDg@public.gmane.org> wrote:> > > Cool stuff. PDI adding a strftime method. :) > > -Thomas > > > Am 15.09.2006 um 20:29 schrieb Martin Ström: > > > Hello, > > I needed to do some date calculations in JS for a project I''m > > working on so I ported the numeric time extensions from Rails to > > JS. Now I can neat things like this: ((3).weeks() + (2).hours() + > > (15).minutes()).fromNow().toDate() > > > > Read more: > > http://burnfield.com/martin/2006/09/15/rails-time-extensions-ported- > > to-javascript > > > > > > Martin Ström > > -- > > burnfield.com/martin > > > > > > > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
> > > Hello, > > > I needed to do some date calculations in JS for a project I''m > > > working on so I ported the numeric time extensions from Rails to > > > JS. Now I can neat things like this: ((3).weeks() + (2).hours() + > > > (15).minutes()).fromNow().toDate() > > > > > > Read more: > > > > http://burnfield.com/martin/2006/09/15/rails-time-extensions-ported- > > > to-javascript > > > > > >In a similar style I added the number percentage and number_to_human_size helpers: http://rails.techno-weenie.net/tip/2006/5/21/number_percentage_and_human_size_implemented_in_javascript -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Ström
2006-Sep-19 10:21 UTC
Re: [ANN] Rails'' numeric time extensions for JavaScript
Great! It would be cool to collect all these JS-ports somewhere for easy access. It wouldn''t have to be part of the prototype/scripta.culo.us core but to make it easier for rails people to find them. On 9/18/06, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > > Hello, > > > > I needed to do some date calculations in JS for a project I''m > > > > working on so I ported the numeric time extensions from Rails to > > > > JS. Now I can neat things like this: ((3).weeks() + (2).hours() + > > > > (15).minutes()).fromNow().toDate() > > > > > > > > Read more: > > > > > > http://burnfield.com/martin/2006/09/15/rails-time-extensions-ported- > > > > to-javascript > > > > > > > > > In a similar style I added the number percentage and > number_to_human_size helpers: > > http://rails.techno-weenie.net/tip/2006/5/21/number_percentage_and_human_size_implemented_in_javascript > > > -- > Rick Olson > http://weblog.techno-weenie.net > http://mephistoblog.com > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Michael Peters
2006-Sep-19 14:06 UTC
Re: [ANN] Rails'' numeric time extensions for JavaScript
Martin Ström wrote:> Great! It would be cool to collect all these JS-ports somewhere for easy > access. It wouldn''t have to be part of the prototype/scripta.culo.us > core but to make it easier for rails people to find them.I''ve suggested a simplified version of CPAN for Prototype/Script.aculo.us before but got no response. -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Ström
2006-Sep-19 14:34 UTC
Re: [ANN] Rails'' numeric time extensions for JavaScript
A really simple solution is to just put it on the wiki and perhaps make a rails-like script/plugin script to list the plugins On 9/19/06, Michael Peters <mpeters-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote:> > > > > Martin Ström wrote: > > Great! It would be cool to collect all these JS-ports somewhere for easy > > access. It wouldn''t have to be part of the prototype/scripta.culo.us > > core but to make it easier for rails people to find them. > > I''ve suggested a simplified version of CPAN for Prototype/Script.aculo.us > before > but got no response. > > -- > Michael Peters > Developer > Plus Three, LP > > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---