Comparing version 0.14.5 to 0.14.8
{ | ||
"name": "date-fns", | ||
"version": "0.14.5", | ||
"version": "0.14.8", | ||
"homepage": "https://github.com/kossnocorp/date-fns", | ||
@@ -5,0 +5,0 @@ "authors": [ |
# Changelog | ||
## v0.14.2 (4 Dec 2014) | ||
## v0.14.8 (25 Dec 2014) | ||
* Bug fixes: | ||
- Fix broken Bower support | ||
- `format` function now behaves correctly with `pm`/`am` | ||
## v0.14.1 (23 Nov 2014) | ||
## v0.14.6 (4 Dec 2014) | ||
* Improvements: | ||
- All of functions now | ||
* Bug fixes: | ||
- Fix broken Bower support | ||
@@ -13,0 +13,0 @@ ## v0.14.0 (5 Nov 2014) |
var path = require('path'); | ||
var config = [ | ||
{ | ||
cache: true, | ||
entry: { | ||
'date_fns': './src/date_fns.js' | ||
}, | ||
output: { | ||
path: path.join(process.cwd(), 'dist'), | ||
filename: '[name].js' | ||
} | ||
var config = { | ||
cache: true, | ||
entry: { | ||
'date_fns': './src/date_fns.js' | ||
}, | ||
{ | ||
cache: true, | ||
entry: { | ||
'date_fns_global': './src/date_fns_global.js' | ||
}, | ||
output: { | ||
path: path.join(process.cwd(), 'dist'), | ||
filename: '[name].js' | ||
} | ||
output: { | ||
path: path.join(process.cwd(), 'dist'), | ||
filename: '[name].js', | ||
library: 'dateFns', | ||
libraryTarget: 'umd' | ||
} | ||
]; | ||
}; | ||
module.exports = config; | ||
@@ -1,2 +0,12 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define(factory); | ||
else if(typeof exports === 'object') | ||
exports["dateFns"] = factory(); | ||
else | ||
root["dateFns"] = factory(); | ||
})(this, function() { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
@@ -47,3 +57,3 @@ /******/ var installedModules = {}; | ||
/* WEBPACK VAR INJECTION */(function(module) {var dateFns = { | ||
var dateFns = { | ||
addDays: __webpack_require__(1), | ||
@@ -80,10 +90,4 @@ addMinutes: __webpack_require__(2), | ||
if (module && module.exports) { | ||
module.exports = dateFns; | ||
} else { | ||
window.dateFns = dateFns; | ||
} | ||
module.exports = dateFns; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30)(module))) | ||
@@ -103,2 +107,8 @@ /***/ }, | ||
date.setDate(date.getDate() + amount); | ||
/** | ||
* add additional 5 hours to get next day, | ||
* because of possible troubles with daylight savings dates | ||
*/ | ||
date = new Date(date.setTime(date.getTime() + 5 * 60 * 60 * 1000)); | ||
date = new Date(date.setHours(0, 0, 0, 0)); | ||
return date; | ||
@@ -164,2 +174,3 @@ }; | ||
var dates = []; | ||
var tmpDate; | ||
@@ -171,3 +182,12 @@ var curDate = new Date(dirtyStart); | ||
dates.push(new Date(curDate)); | ||
curDate.setDate(curDate.getDate() + 1); | ||
/** | ||
* add additional 5 hours to get next day, | ||
* because of possible troubles with daylight savings dates | ||
*/ | ||
tmpDate = new Date(curDate.setTime(curDate.getTime() + 5 * 60 * 60 * 1000)); | ||
tmpDate = new Date(tmpDate.setHours(0, 0, 0, 0)); | ||
curDate = tmpDate; | ||
} | ||
@@ -893,19 +913,4 @@ | ||
/***/ }, | ||
/* 30 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = function(module) { | ||
if(!module.webpackPolyfill) { | ||
module.deprecate = function() {}; | ||
module.paths = []; | ||
// module.parent = undefined by default | ||
module.children = []; | ||
module.webpackPolyfill = 1; | ||
} | ||
return module; | ||
} | ||
/***/ } | ||
/******/ ]) | ||
/******/ ]) | ||
}); |
{ | ||
"name": "date-fns", | ||
"version": "0.14.5", | ||
"version": "0.14.8", | ||
"author": "Sasha Koss <kossnocorp@gmail.com>", | ||
@@ -15,3 +15,3 @@ "description": "Date helpers", | ||
"karma-phantomjs-launcher": "^0.1.4", | ||
"karmak": "^0.1.1", | ||
"karmak": "^0.2.1", | ||
"webpack": "^1.4.4" | ||
@@ -18,0 +18,0 @@ }, |
# date-fns | ||
[![](http://img.shields.io/npm/v/date-fns.svg)](https://www.npmjs.org/package/date-fns) | ||
[![Build Status](https://travis-ci.org/kossnocorp/date-fns.svg)](https://travis-ci.org/kossnocorp/date-fns) | ||
[![Build Status](https://travis-ci.org/js-fns/date-fns.svg)](https://travis-ci.org/js-fns/date-fns) | ||
@@ -5,0 +5,0 @@ Date helpers in function-per-file style. |
@@ -117,2 +117,12 @@ var format = require('../format'); | ||
}); | ||
it('12 pm', function() { | ||
var date = new Date(1986, 3, 4, 12, 00, 0, 900); | ||
expect(format(date, 'hh:mm a')).to.be.equal('12:00 pm'); | ||
}); | ||
it('12 am', function() { | ||
var date = new Date(1986, 3, 4, 00, 00, 0, 900); | ||
expect(format(date, 'h:mm a')).to.be.equal('0:00 am'); | ||
}); | ||
}); | ||
@@ -119,0 +129,0 @@ |
@@ -10,2 +10,8 @@ /** | ||
date.setDate(date.getDate() + amount); | ||
/** | ||
* add additional 5 hours to get next day, | ||
* because of possible troubles with daylight savings dates | ||
*/ | ||
date = new Date(date.setTime(date.getTime() + 5 * 60 * 60 * 1000)); | ||
date = new Date(date.setHours(0, 0, 0, 0)); | ||
return date; | ||
@@ -12,0 +18,0 @@ }; |
@@ -33,7 +33,2 @@ var dateFns = { | ||
if (module && module.exports) { | ||
module.exports = dateFns; | ||
} else { | ||
window.dateFns = dateFns; | ||
} | ||
module.exports = dateFns; |
@@ -10,2 +10,3 @@ /** | ||
var dates = []; | ||
var tmpDate; | ||
@@ -17,3 +18,12 @@ var curDate = new Date(dirtyStart); | ||
dates.push(new Date(curDate)); | ||
curDate.setDate(curDate.getDate() + 1); | ||
/** | ||
* add additional 5 hours to get next day, | ||
* because of possible troubles with daylight savings dates | ||
*/ | ||
tmpDate = new Date(curDate.setTime(curDate.getTime() + 5 * 60 * 60 * 1000)); | ||
tmpDate = new Date(tmpDate.setHours(0, 0, 0, 0)); | ||
curDate = tmpDate; | ||
} | ||
@@ -20,0 +30,0 @@ |
@@ -87,6 +87,7 @@ var startOfDay = require('./start_of_day'); | ||
'h': function() { | ||
return this.getHours() % 12; | ||
var hours = this.getHours(); | ||
return hours > 12 ? hours % 12 : hours; | ||
}, | ||
'hh': function() { | ||
return leftZeroFill(this.getHours() % 12, 2); | ||
return leftZeroFill(formats['h'].apply(this), 2); | ||
}, | ||
@@ -97,3 +98,3 @@ 'm': function() { | ||
'mm': function() { | ||
return leftZeroFill(this.getMinutes()); | ||
return leftZeroFill(this.getMinutes(), 2); | ||
}, | ||
@@ -100,0 +101,0 @@ 's': function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73
76981
2226