Datepicker disapearing on setValue();

Hi all,
I have two datepickers within my moreToolbar. the first datepicker1 has day and year hidden to show only the month. the second datepicker2 has day and month hidden to show year only.

The problem is that whenever I run this function this.$.datepicker1.setValue("Dec"); for instance, datepicker1 disapears and yet I know the month is correctly changed to Dec when I get the datepicker1 value back.

How can i prevent the datepicker from disapearing when I programatically set the value?

any help or pointer appreciated.

Comments

  • the date picker wants a Date value, not a string. If you want to set it to December, you need to set a value like new Date("December 1, 2000"). The picker is disappearing because the value you set doesn't have the Date object's methods and an exception is being thrown.
Sign In or Register to comment.