This package provides utilities for manipulating dates and times in JavaScript.
You can install this package via npm. Make sure you have Node.js installed.
npm install datetime-manipulation
You can import the package in your JavaScript/TypeScript files as follows:
import { DateTimeUtils } from "datetime-manipulation";
This method adds the specified number of days to the given date.
This method subtracts the specified number of days from the given date.
This method formats the given date according to the specified format string. The format string follows the rules of the Moment.js library.
import { DateTimeUtils } from "datetime-manipulation";
const today = new Date();
const tomorrow = DateTimeUtils.addDays(today, 1);
console.log("Tomorrow:", tomorrow);
const formattedDate = DateTimeUtils.formatDate(tomorrow, "YYYY-MM-DD");
console.log("Formatted Date:", formattedDate);
Contributions are welcome! Feel free to open an issue or submit a pull request.
This package is licensed under the MIT License. See the LICENSE file for details.