This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/graphql-types/node_modules/date-fns/is_same_iso_week/index.js

29 lines
826 B
JavaScript

var isSameWeek = require('../is_same_week/index.js')
/**
* @category ISO Week Helpers
* @summary Are the given dates in the same ISO week?
*
* @description
* Are the given dates in the same ISO week?
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param {Date|String|Number} dateLeft - the first date to check
* @param {Date|String|Number} dateRight - the second date to check
* @returns {Boolean} the dates are in the same ISO week
*
* @example
* // Are 1 September 2014 and 7 September 2014 in the same ISO week?
* var result = isSameISOWeek(
* new Date(2014, 8, 1),
* new Date(2014, 8, 7)
* )
* //=> true
*/
function isSameISOWeek (dirtyDateLeft, dirtyDateRight) {
return isSameWeek(dirtyDateLeft, dirtyDateRight, {weekStartsOn: 1})
}
module.exports = isSameISOWeek