timezone-mock
Advanced tools
+17
-1
@@ -179,3 +179,19 @@ var assert = require('assert'); | ||
| } | ||
| return 'Mockday ' + this.d.toISOString() + ' GMT-0' + this.calcTZO() + '00 (MockDate)'; | ||
| var str = [this.d.toISOString() + ' UTC (MockDate: GMT']; | ||
| var tzo = -this.calcTZO(); | ||
| if (tzo < 0) { | ||
| str.push('-'); | ||
| tzo *= -1; | ||
| } else { | ||
| str.push('+'); | ||
| } | ||
| str.push(Math.floor(tzo).toString().padStart(2, '0')); | ||
| tzo -= Math.floor(tzo); | ||
| if (tzo) { | ||
| str.push(tzo * 60); | ||
| } else { | ||
| str.push('00'); | ||
| } | ||
| str.push(')'); | ||
| return str.join(''); | ||
| }; | ||
@@ -182,0 +198,0 @@ |
+1
-1
| { | ||
| "name": "timezone-mock", | ||
| "version": "1.0.18", | ||
| "version": "1.1.0", | ||
| "description": "A JavaScript library to mock the local timezone.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
26475
1.06%913
1.78%