Closed adrianolobo closed 8 years ago
Hi, you did some mistakes.
on-change
not ng-change
, and exactly in this form on-change="vm.validateDate(date)"
. (Just in case, adm-dtp do not let user put wrong date.)mindate
expression in quotationSee what you want in this Plunker
Ok, thank you.
The on-change worked very well.
I'm using the date in this format: "YYYY/MM/DD" not in unix, that's why I used the quotation.
<adm-dtp ng-model="date" options="{default:'2015/12/15'}" mindate="1449866902553" maxdate="'2015/12/18'"></adm-dtp>
I could not replicate the bug in your plunker, I think it was fixed in version 1.1.4, I got version 1.1.0 from bower.
Yeah, I keep getting that error even in the new version when i write something that is not a proper date.
TypeError: Cannot read property 'replace' of undefined
I'm using the date in this format: "YYYY/MM/DD" not in unix, that's why I used the quotation.
Yes, you're right, and your last code that i think is from demo page is correct, but in your first code mindate="'{{vm.today}}'"
must be changed to mindate="{{vm.today}}"
.
Could you please put your code that gives this error in Plunker to help me see if it's a bug or maybe you pass the number
instead of string
by mistake. (e.g. <adm-dtp ng-model="date" options="{default:'1449866902553'}"></adm-dtp>
, the unix is number, but passed as string)
When I use the datetimepicker with an custom input element like that:
` <adm-dtp ng-model='vm.entity.date_start' ng-change="vm.validateDate('start',vm.entity.date_start)" options="{multiple:false}" mindate="'{{vm.today}}'"
And i change the date in the input by hand i get this error in the console: TypeError: Cannot read property 'replace' of undefined