corrected small typo at datePicker.js

This commit is contained in:
Carlos 2017-09-19 15:03:39 +02:00
parent 2e5989cc7f
commit e76f1d74f9
1 changed files with 3 additions and 3 deletions

View File

@ -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/`);
}
}