0

I am using http://angular-ui.github.io/ui-calendar/ in my application.

I want to add birthday event that repeat each year.

for example

student 1 birthday is 12-jan-2006.

$scope.birthdayEvent = [
        {title:'ABC',start:'2006-1-12',allDay: true,stick:true}]

This is show event in 2006 calendar.

I want this event to be shown all years the 12th January. How can I do it?

Mistalis
  • 17,793
  • 13
  • 73
  • 97
Kinjal Shah
  • 577
  • 1
  • 5
  • 15

1 Answers1

0

When the app is open it just checks the current year and evaluates the current year in the birthDay expression. So, when the app opens every time or executes, It will get the current year from the Date and sets the year:

$scope.birthDay = new Date(new Date().getFullYear(), 0, 12);

$scope.birthdayEvent = [
        {title: 'ABC', start: $scope.birthDay, allDay: true, stick: true}
]
Mr_Perfect
  • 8,254
  • 11
  • 35
  • 62