Rails' time extensions is submitted!
Your script is now in the approval queue. After a quick review we will notify you of the script's status by email. If everything's alright, we'll publish your work to the site and rss feed. Otherwise, we'll send you the email explaining what seems questionable. In that case, reply to the email whenever we should review the script again.
Also, don't hesitate to discuss things if you feel that our reasons are unfair. We are real folk, and we don't like bureaucracy. : )
Thank you for your contribution!
1
Rails' time extensions
Edit script
I’ve ported Rails’ Numeric Time extensions to JavaScript since I needed to do some date calculations for a project I’m working on. Now one should be able to calculate dates in JS like this:
(5).seconds() // => 5000
(2).weeks() + (2).hours() + (15).seconds() // => 1216815000
(1).week().fromNow().toDate() // => Fri Sep 22 2006 19:16:32 GMT+0200 (CEST)
var date = new Date(2000, 11, 18, 18, 15, 23);
(2).years().since(date).toDate() // => Thu Dec 19 2002 06:15:23 GMT+0100 (CET)
- Website:
-
Rails' time extensions
- Author:
-
Martin Ström
- Size:
- 0.5 KB
- Last modified:
- 11/06/2007
- License:
-
n/a
- Tags:
- date & time
- Rating:
-
4
(4/5 from 1 vote)
- Your rating:
-
0
Not yet rated
- Please sign in or register to rate this script
- You can't rate your own script.