Change calendar system to Jalali canendar
See original GitHub issueI want to user react-dates
as a Persian datepicker. Persians use another calendar system that called jalali calendar
. We have a popular library called moment-jalaali that works perfectly as a moment
plug-in.
Now my question is that: How we can use jalali calendar
system with react-dates
?
I try below code, but it’s just change locale and strings not entire calendar system.
import React, { Component } from 'react';
import './App.css';
import moment from 'moment-jalaali';
import { DateRangePicker, SingleDatePicker, DayPickerRangeController } from 'react-dates';
import 'react-dates/lib/css/_datepicker.css';
class App extends Component {
render() {
moment.loadPersian(); // >>>>>>>>>> This change locale to Persian successfully but how to change calendar system?
return (
<div className="App">
<SingleDatePicker
date={moment()}
onDateChange={date => console.log(date)} // PropTypes.func.isRequired
focused={true}
onFocusChange={({ focused }) => console.log(focused)} // PropTypes.func.isRequired
/>
</div>
);
}
}
export default App;
This is output screen shot for above code you can see that calendar system is wrong:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Change calendar system to Jalali canendar #447 - GitHub
I want to user react-dates as a Persian datepicker. Persians use another calendar system that called jalali calendar.
Read more >Jalali calendar - Wikipedia
However, the original Jalali calendar based on observations (or predictions) of solar transit would not have needed either leap years or seasonal adjustments....
Read more >Can Forms be customized to support Jalali Calendar in the ...
One of our prospective customers want to use this Jalali (Persian) calendar. I changed the NLS_CALENDAR for the session to Persian and this...
Read more >Set Jalali Calendar as system date or ... - Ubuntu Mailing Lists
Previous message: Set Jalali Calendar as system date or ... Next message: default configuration issue in teeworlds 0.4.2.1... Messages sorted by ...
Read more >Gregorian < > Persian Calendar Converter
The Persian Calendar Converter can convert from any date according to the Gregorian Calendar into a date according to the Persian or Iranian...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
renderMonth
andrenderDay
fixes the locale problem but the issue with the calendar itself still stands.First of the month in the calendar is marked 11, which is 11th of the respective month in Jalali while it should obviously be 1. Am I missing something?
Sounds grate, if this issue is fixed many more people will start replacing their code with this date picker. Please notify people at this thread if this issue is fixed.