Getting Started with the Kendo UI Date Math
This guide provides the information you need to start using the Kendo UI Date Math—it includes instructions about the installation approach, how to import the required methods, and links to additional resources.
Installing the Package
To add the Kendo UI Date Math package, run the following command:
npm install --save @progress/kendo-date-math
Using the Package
-
After successfully installing the Date Math, import the required individual functions from the package:
import { weekInYear, addDays } from '@progress/kendo-date-math';
-
Then you can perform the desired date manipulations. The following code snippet demonstrates how to calculate the week number, based on a given date, using the
weekInYear
function:const date = new Date(2000, 10, 10); const weekNumber = weekInYear(date); console.log(weekNumber); // Returns the week number of the corresponding date.
Dependencies
The Kendo UI Date Math package has no external dependencies.