JiriBalcar / angular-datepickr

Angular datepicker
MIT License
5 stars 0 forks source link

Format and ViewFormat Options not working. #2

Closed user123x1 closed 7 years ago

user123x1 commented 7 years ago

When trying to set format option as 'MM-DD-YYYY', the default formats seem override. Maybe hard code.

default: format: string format for model value 'DD.MM.YYYY' viewFormat: string format for view 'DD.MM.YYYY'

Thanks,

JiriBalcar commented 7 years ago

Did you set it as global options or in the template?

user123x1 commented 7 years ago

Yes, I tried both global and local options. Its seems to be hard code in the following file. datepicker-container.component.ts (not reading from options) example: (several other places within the file)

generateCalendar(..)

let firstDay = moment(`01.${month + 1}.${year}`, 'DD.MM.YYYY'); 
JiriBalcar commented 7 years ago

Can you try to install version 0.3.4-beta1?

npm install angular2-datepickr@beta

Should be fixed.

user123x1 commented 7 years ago

Yes, the date format options and arrow icons are fixed now at least for the input component. But now we have a new error for the jb-text-datepicker component with the following error message:

error_handler.js:48 EXCEPTION: Error in ./TextDatePickerComponent class TextDatePickerComponent - inline template:1:5 caused by: Cannot read property 'preventDefault' of undefined

JiriBalcar commented 7 years ago

Should be fixed in 0.3.4-beta3

user123x1 commented 7 years ago

Looks good! Thank you for a fast response time. :+1:

JiriBalcar commented 7 years ago

You are welcome ;-)