Fixed bug in datepicker directive.