Skip to content

CDN based example

Farhan Reza edited this page Feb 19, 2024 · 5 revisions

Welcome to the diff-ymd-package wiki👋

Welcome to the CDN based example page of diff-ymd-package!

<!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

For more information, support or help, contact us:

Farhan Reza's GitHub Farhan Reza's LinkedIn

Clone this wiki locally