Open saeedvir opened 8 years ago
It is not enough with the following settings?
$("datepicker").bootstrapMaterialDatePicker({
lang: "fa"
});
bootstrap-material-datetimepicker
uses moment.js
's locale.
http://momentjs.com/
lang: "fa"
just change appearance of months and days names. How do i change to persian calendar?
Sorry, I was wrong. I think following probably works.
First, load https://github.com/fingerpich/jalali-moment instead of moment.js.
Now, global variable moment
is jalali-moment.
And initialize locale fa
.
$(".datepicker").bootstrapMaterialDatePicker({
lang: "fa"
});
When jalali-moment set locale to fa
, jalali-moment uses persian calendar system.
Thanks. That works fine. But now, I have to problems:
I
.i =invalid date
in line 734 find
for (var ii = 0; ii < calendar.week.length; ii++) { _template += '<th>' + moment(parseInt(calendar.week[ii]), "d").locale(this.params.lang).format("dd").substring(0, 1) + '</th>'; }
and comment it and add static code:
_template += '<th>' + 'ش' + '</th>'; _template += '<th>' + 'ی' + '</th>'; _template += '<th>' + 'د' + '</th>'; _template += '<th>' + 'س' + '</th>'; _template += '<th>' + 'چ' + '</th>'; _template += '<th>' + 'پ' + '</th>'; _template += '<th>' + 'ج' + '</th>';
and in init : weekStart=6
please add persian calendar
http://babakhani.github.io/PersianWebToolkit/doc/datepicker/0.4.5/