date-fns-jalali
Version:
Modern JavaScript date utility library for jalali calendar
36 lines (33 loc) • 952 B
JavaScript
;
exports.startOfTomorrow = startOfTomorrow;
var _index = require("./_core/getMonth.js");
var _index2 = require("./_core/getDate.js");
var _index3 = require("./_core/getFullYear.js");
var _index4 = require("./_core/setFullYear.js");
var _index5 = require("./_core/newDate.js");
/**
* @name startOfTomorrow
* @category Day Helpers
* @summary Return the start of tomorrow.
* @pure false
*
* @description
* Return the start of tomorrow.
*
* @returns The start of tomorrow
*
* @example
* // If today is 6 October 2014:
* const result = startOfTomorrow()
* //=> Tue Oct 7 2014 00:00:00
*/
function startOfTomorrow() {
const now = (0, _index5.newDate)();
const year = (0, _index3.getFullYear)(now);
const month = (0, _index.getMonth)(now);
const day = (0, _index2.getDate)(now);
const date = (0, _index5.newDate)(0);
(0, _index4.setFullYear)(date, year, month, day + 1);
date.setHours(0, 0, 0, 0);
return date;
}