2015-07-13 30 views
3

試圖從datepicker框架改變佛教年代+543年,但它沒有工作。如何更新datepicker Year至佛教時代

我用這個框架代碼此鏈接http://keith-wood.name/datepick.HTML 我讀文件的日期功能,並試圖此代碼,但再次notworked :(

$('.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)); 
} 

如何543年請幫助我

回答

1

我想你出現錯誤的原因是,您爲當前日期添加543年而設置的年份在日曆中不可用 請發佈完整代碼以便檢查 首先嚐試將日曆模式更改爲泰文

由於泰國日曆一樣佛曆 https://en.wikipedia.org/wiki/Thai_solar_calendar

注:所以你需要使用日曆控件這個泰國日曆選項是不是在日期選擇器可用。

http://keith-wood.name/calendars.html

這裏是樣品

<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> 
+0

calendarpicker不是我的網站監守我用jQuery的版本2.0.2,但calendarpicker使用1.11,但日期選擇器可以使用的jQuery 2.0.2 – iwebsmile

+0

使用如何在基思木日期選擇器使用日曆泰? – tarzanbappa

+0

我下載了keith-wood datepicker和日曆選取器。他們都在使用jQuery 1.11 – tarzanbappa

2

我有自定義的佛教時代,從下面的鏈接,並使用它普萊舍下載代碼的日期選擇器。

http://wikisend.com/download/519978/datepicker_buddhist.zip 

感謝,