corrected small typo at datePicker.js
This commit is contained in:
parent
2e5989cc7f
commit
e76f1d74f9
|
@ -4,7 +4,7 @@ import Flatpickr from 'vendor/src/flatpickr';
|
|||
import './style.scss';
|
||||
|
||||
// equivalences to format date between flatpicker and angularjs
|
||||
export const fromatEquivalence = {
|
||||
export const formatEquivalence = {
|
||||
d: 'dd', // Day of the month, 2 digits with leading zeros (01 to 31)
|
||||
j: 'd', // Day of the month without leading zeros (1 to 31)
|
||||
m: 'MM', // Month in year, padded (01-12)
|
||||
|
@ -67,7 +67,7 @@ class DatePicker extends Component {
|
|||
let parts = [];
|
||||
aux.forEach(
|
||||
val => {
|
||||
parts.push(fromatEquivalence[val]);
|
||||
parts.push(formatEquivalence[val]);
|
||||
}
|
||||
);
|
||||
if (string.indexOf(' ') !== -1 || string.indexOf('T') !== -1) { // datetime format
|
||||
|
@ -152,7 +152,7 @@ class DatePicker extends Component {
|
|||
}
|
||||
format.forEach(
|
||||
val => {
|
||||
if (!fromatEquivalence[val]) {
|
||||
if (!formatEquivalence[val]) {
|
||||
throw new Error(`Error in dateFormat ${this.iniOptions.dateFormat}: is not like Flatpickr Formatting Token https://chmln.github.io/flatpickr/formatting/`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue