Skip to content

camelmasa/date-range-picker2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

date-range-picker

Date Range Picker for mobile (for now).

Usage

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
    <title>Date Range Picker Demo</title>
  </head>
  <body>
    <div>
      <div id="date-range-picker"></div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/date-range-picker2/dist/index.js"></script>
    <script>
      const picker = DateRangePicker({
        locale: "en",
        submit: (startDay, endDay) => {
          const message = 'Selected from ' + startDay.format('YYYY/MM/DD') + ' to ' + endDay.format('YYYY/MM/DD') + '.';
          console.log(message);
        },
        cancel: () => {
          const message = 'Tapped cancel button.';
          console.log(message);
        }
      });
      picker.render('date-range-picker');
    </script>
  </body>
</html>

About

Date Range Picker for mobile (for now)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published