index.js 582 B

12345678910
  1. import startOfUTCWeek from "../startOfUTCWeek/index.js";
  2. import requiredArgs from "../requiredArgs/index.js"; // This function will be a part of public API when UTC function will be implemented.
  3. // See issue: https://github.com/date-fns/date-fns/issues/376
  4. export default function isSameUTCWeek(dirtyDateLeft, dirtyDateRight, options) {
  5. requiredArgs(2, arguments);
  6. var dateLeftStartOfWeek = startOfUTCWeek(dirtyDateLeft, options);
  7. var dateRightStartOfWeek = startOfUTCWeek(dirtyDateRight, options);
  8. return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();
  9. }