How to update a date from a date to the Buddhist era
Tried to change Buddhist era year +543 from datepicker frame but didn't work.
I used this framework code of this link http://keith-wood.name/datepick.HTML I read the document date function and tried to execute this code but didn't work again :(
$('.picker').change(periods);
function periods() {
var date = new Date($('.picker').datepick('getDate')[0].getTime());
$.datepick.add(date, parseInt(543), 'y');
$('.picker').val($.datepick.formatDate(date));
}
How to Year +543 pls help me
source to share
I think you are getting the error because the year you set by adding 543 for the current date is not available in the calendar. please write the complete code for verification. First of all, try changing your calendar mode to Thai.
Because the Thai calendar is the same as the Buddhist calendar https://en.wikipedia.org/wiki/Thai_solar_calendar
Note. This Thai calendar option is not available in the datepicker, so you need to use the calendar control.
http://keith-wood.name/calendars.html
Here's an example
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>jQuery Calendars Datepicker</title>
<link rel="stylesheet" href="jquery.calendars.picker.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery.plugin.js"></script>
<!--<script src="jquery.calendars.all.js"></script><!-- Use instead of calendars, plus, and picker below -->
<script src="jquery.calendars.js"></script>
<script src="jquery.calendars.plus.js"></script>
<script src="jquery.calendars.picker.js"></script>
<!--<script src="jquery.calendars.picker.ext.js"></script><!-- Include for ThemeRoller styling -->
<script src="jquery.calendars.thai.js"></script>
<script>
$(function() {
// $.calendars.picker.setDefaults({renderer: $.calendars.picker.themeRollerRenderer}); // Requires jquery.calendars.picker.ext.js
var calendar = $.calendars.instance('thai');
$('#inlineDatepicker').calendarsPicker({calendar: calendar, onSelect: showDate});
});
function showDate(date) {
alert('The date chosen is ' + date);
}
</script>
</head>
<body>
<div id="inlineDatepicker"></div>
</body>
</html>
source to share