Dear Support, I have read the documentation : https://ej2.syncfusion.com/vue/documentation/datetimepicker/globalization/
I have 3 questions about it :
1/ I don't know how to do the same in french.
Is there some special json file needed ?
3/ Moreover, I can I prevent the user from writting a date (or anything else) by himself in the input part of the datepicker ?
I would like to user to be only able to select a date from the datePicker calendar, not to write something on his own.
3/ I would like to force the format to be "yyyy-mm-dd".
I wrote this :
But when I type "01/01/2021" and submit it I have no validator mystake.
What did I do wrong ?
best regards
|
<template>
<div class="control_wrapper">
<ejs-datepicker id="datepicker" locale="fr"></ejs-datepicker>
</div>
</template>
<script>
import Vue from "vue";
import { DatePickerPlugin } from "@syncfusion/ej2-vue-calendars";
import { L10n , loadCldr} from "@syncfusion/ej2-base";
Vue.use(DatePickerPlugin);
loadCldr(
require('cldr-data/main/fr/numbers.json'),
require('cldr-data/main/fr/ca-gregorian.json'),
require('cldr-data/main/fr/numbers.json'),
require('cldr-data/main/fr/timeZoneNames.json'),
require('cldr-data/supplemental/weekdata.json') // To load the culture based first day of week
);
L10n.load({
fr: {
datepicker: {
"today": "Aujourd'hui",
"placeholder": "Choisissez une date"
}
}
});
export default Vue.extend({
data: function() {
return {};
}
});
</script> |
|
<ejs-datepicker id="datepicker" :allowEdit=allowEdit locale="fr"></ejs-datepicker>
export default Vue.extend({
data: function() {
return {
allowEdit:false
};
}
}); |
|
<ejs-datepicker id="datepicker" :allowEdit=allowEdit locale="fr" format="yyyy-mm-dd"></ejs-datepicker> |
Thank you for the answer.
I tried to do it as you said, but got the error "
calendar.js?9f52:284 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at DatePicker.CalendarBase.getCultureValues (calendar.js?9f52:284)
at DatePicker.CalendarBase.createContentHeader (calendar.js?9f52:320)
at DatePicker.CalendarBase.createContent (calendar.js?9f52:268)
at DatePicker.Calendar.createContent (calendar.js?9f52:2230)
at DatePicker.CalendarBase.render (calendar.js?9f52:140)
at DatePicker.Calendar.render (calendar.js?9f52:2086)
at DatePicker.show (datepicker.js?dd17:1149)
at VueComponent.DatePickerComponent.show (datepicker.component.js?26d8:116)
at VueComponent.onFocus (Create.vue?edf9:187)"
Can you help me ? Here is the zip file.
I did npm install cldr-data --save
I can see it in my package JSON file :
So I need to get cldr-data in the package.json file and in the node module folder ? Do you mean I have to put your cldr-data folder in here ? :
capture
Because as you can see, I have to nodes_modules folder at different places.