Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Date.addMinute()

  • Loading branch information...
commit 9b39d006616377f9bdf0e3db65e36a71698040f7 1 parent 345029a
@dresende authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/date.js
View
7 lib/date.js
@@ -4,6 +4,7 @@
*
* Extension
* ---------
+ * .addMinute() Add one or more minutes to the Date
* .addHour() Add one or more hours to the Date
* .addDay() Add one or more days to the Date
* .addWeek() Add one or more weeks to the Date
@@ -17,6 +18,12 @@
(function () {
var Extensions = {};
+ Extensions.addMinute = function (n) {
+ var dt = new Date();
+ dt.setTime(this.getTime() + (60e3 * (n || 1)));
+
+ return dt;
+ };
Extensions.addHour = function (n) {
var dt = new Date();
dt.setTime(this.getTime() + (3600e3 * (n || 1)));
Please sign in to comment.
Something went wrong with that request. Please try again.