-
-
Notifications
You must be signed in to change notification settings - Fork 11
CDN based example
Farhan Reza edited this page Feb 21, 2024
·
5 revisions
Welcome to the diff-ymd-package wiki👋
<!DOCTYPE html>
<html>
<head>
<!-- Download diff-ymd-package from CDN -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.min.js">
</script>
</head>
<body>
<script>
// Use diff-ymd-package DatesYMD constructor or DatesYMD global object to create an instance
const date1 = '2022-01-01';
const date2 = '2023-12-31';
const Formatter = new DatesYMD(date1, date2); // DatesYMD global constructor
// Or can use DatesYMD global object diffDates method
//const Formatter = DatesYMD.diffDates(date1, date2); // Can use any
// Use diff-ymd-package Methods on created instance(Formatter)
</script>
<!-- Or not mix html with javascript -->
<!-- For this include a script tag for script using diff-ymd-package -->
<!-- example: <script src="format-difference.js"></script> -->
</body>
</html>Use diff-ymd-package Methods on created instance(Formatter)
Use Methods to format difference, See here
Get Built in codes for using diff-ymd-package any Method on created instance(Formatter)