Comments (3)
i used day.js and jalaliday for initial value :
const date = dayjs(date).calendar('jalali').locale('fa')
<DatePickerJalali
format={'YYYY/MM/DD'}
value={date }
/>
from antd-jalali.
i used day.js to get the object of date and then set that as initial value
date: dayjs(
Jmoment.from(selectedField.contract.datetime, 'YYYY-MM-DD')
.locale('fa')
.format('YYYY-MM-DD'),
).locale('fa')
from antd-jalali.
Hi Saeed
Are you sure that default value will work with dayjs object?
I try it in different ways, but I didn't get any hopeful results.
When you set default value with dayjs object, it will throw:
TypeError: clone.weekday is not a function
Because clone().weekday()
is a function of moment, not dayjs.
I think you did wrong.
Currently, the only way of setting default value is moment. But when the value set by moment
, it goes crasy because you mixed up moment
and dayjs
.
Can you set a default value in your demo page?
from antd-jalali.
Related Issues (20)
- defaultPickerValue not working HOT 1
- please add RTL support to ant-design-pro HOT 1
- bug in mounth length HOT 1
- problem with using in nextjs HOT 4
- Error calling localized month name formatting after instantiating any controls. HOT 2
- persian numbers for days and years HOT 1
- year in date-picker is suddenly Gregorian after updating dayjs and antd HOT 2
- overwritten css styles in Nextjs
- Unexpected token! HOT 1
- change numbers of date picker to farsi font HOT 1
- incompatibility with some libraries HOT 2
- Beginning of the first day of the month, with the wrong day HOT 3
- After typing in jalali, it will be converted to Gregorian
- Error in build HOT 2
- Wrong Week Days HOT 5
- Error hot fix HOT 1
- Error styles HOT 1
- how to set value HOT 3
- error set default value HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antd-jalali.