Closed MR-Mostafa closed 3 years ago
Perhaps v2 can help here (currently in beta).
https://jsfiddle.net/Le5f2zvb/
I don't know if this displays correctly, but I hope you can find a way to adapt it.
Perhaps v2 can help here (currently in beta). https://jsfiddle.net/Le5f2zvb/ I don't know if this displays correctly, but I hope you can find a way to adapt it.
Thanks a lot, it's almost ok, but there are some problems:
1) In Jalali (solar) date, the first day of the week is Saturday (fixed with firstDay: 6
property).
2) Shows the year incorrectly (shows in Gregorian calendar, not solar)
3) The days of the month are displayed correctlym, but the first day of the month does not separate from the previous month in view (ui).
4) When we select a date range it does not display correctly in the input.
@wakirin The fourth problem was solved by changing the following code:
output(date) {
return new persianDate(date).format("dddd, ha");
}
output(date) {
return new persianDate(date).format("YYYY/M/D");
}
https://jsfiddle.net/txc40ehj/
This should fix 2 and 3. Not sure if I got it right about 3.
@wakirin No, the problem is not solved. When we change the months, the year 1399 is still displayed and does not change to the next year. I'm trying to solve the problem of the year, but I have no idea how to show the days. (The third problem)
Try to replace:
el.innerHTML = ' ' + new persianDate(year).format('YYYY');
to
el.innerHTML = ' ' + new persianDate([year]).format('YYYY');
I don't understand very well about problem 3. Could you show the expected result ?
@wakirin For the third problem, I mean that each month should start from the beginning of the same month (solar month) and not from the continuation of the previous month (Gregorian month).
In short: I mean the days of each month (solar month) should be displayed in the same month and in the same column
Currently, only the Gregorian months are displayed in the calendar.
You can try change this behavior with v2 beta.5 using .on('render:month', (month, date) => {..});
for the render days, which is what you want.
@MR-Mostafa I prepared a new example with v2 and plugin.
https://dev.lvl.ninja/litepicker/jalali.html
Currently some options may have not work (like lockDays
, minDate
, maxDate
, etc)
Hi, Years is displayed Wrong. it should be 1400 when we using lang:"fa".
Hi Sorry, no news for the new plugin of jalali calendar? @wakirin
Is your feature request related to a problem? Please describe. No
Describe the solution you'd like Hello Is any way to your datepicker support jalali calendar (Persian Calendar)? For logic difference between these dates(jalali & gregorian) you can use: Persian Date OR jalaali-js Thanks