-1

i want to have possibility click on some button on my page and datepicker will change view to prev/next month/year (normal datepicker have this option above calendar).

I found out that function responsible for that is move(number) but how can i invoke this function outside directive?

I have to decorate datepicker or their is simpler solution?

J. Doe
  • 1

1 Answers1

1

The uib datepicker accepts an ng-model. A simple way to change the time with a button would be do write a function to modify the model you've passed in. This would mean you wouldn't have to mess with the functions in bootstrap, just modify the dt object. There are a few ways of modifying a javascript dt object, see Incrementing a date in JavaScript.

Community
  • 1
  • 1
jakhicks
  • 584
  • 1
  • 5
  • 8
  • But i want change view of calendar, not model. For example i choose 4.01.2015 on datepicker (i see month february on calendar) If I want change view to december 2015 - i have to click on left icon ( glyphicon-chevron-left), i dont want change model with my date. – J. Doe Jan 15 '16 at 12:35
  • And i need to transfer this icon into other area - for example calendar on header, change view to next/prev month on footer my page – J. Doe Jan 15 '16 at 12:41
  • With angulars two way binding, by changing the date model the calendar's view should automatically update. I'll make a jsFiddle with it later on if I get some time. – jakhicks Jan 15 '16 at 15:26