Last active
March 31, 2016 03:40
-
-
Save yszk0123/c07107a1138534519cb9 to your computer and use it in GitHub Desktop.
Pikaday Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Pikaday Example</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment-with-locales.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pikaday/1.4.0/pikaday.min.js"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pikaday/1.4.0/css/pikaday.min.css"> | |
</head> | |
<body> | |
<input type="text" id="datepicker" value="2016"> | |
<script> | |
moment.locale('ja'); | |
var picker = new Pikaday({ | |
i18n: { | |
previousMonth: 'Previous Month', | |
nextMonth: 'Next Month', | |
months: moment.months(), | |
weekdays: moment.weekdays(), | |
weekdaysShort: moment.weekdaysShort() | |
}, | |
minDate: moment().add(3, 'day').toDate(), | |
maxDate: moment().add(50, 'day').toDate(), | |
defaultDate: moment().add(5, 'day').toDate(), | |
setDefaultDate: true, | |
showMonthAfterYear: true, | |
field: document.getElementById('datepicker'), | |
format: 'YYYY MMMM D', | |
onSelect: function() { | |
/* something */ | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment