icai / vue3-calendar

vue 2.x vue 3.x calendar component
https://icai.github.io/vue3-calendar/
MIT License
494 stars 89 forks source link

Custom format not working #35

Closed mtleppay closed 10 months ago

mtleppay commented 6 years ago

Hello, when i'm trying to format date with dots. but it doesn't work. I need 'dd.MM.yyyy' format. Any suggestions?

crimsonimp commented 5 years ago

@mtleppay You can solve the problem by changing next if statement in Calendar component:

if (str.length === 10 && (this.dateFormat === 'dd-MM-yyyy' || this.dateFormat === 'dd/MM/yyyy'))

change to this

if (str.length === 10 && (this.dateFormat === 'dd.MM.yyyy' || this.dateFormat === 'dd-MM-yyyy' || this.dateFormat === 'dd/MM/yyyy'))