date-range-picker2
v0.0.2
Published
Date Range Picker
Downloads
5
Readme
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>