rubyist
rubyist

Reputation: 3132

jquery full calendar

I am trying to integrate full calendar plugin (adam Arshaw's). I need to display the month name. When i try to alert month.getMonth(); it shows the numeric value of month. ie. for July month it shows 7. I need to display it as full Month. for eg. Jul or July. How is it possible? Please help

Upvotes: 2

Views: 798

Answers (2)

Brandon
Brandon

Reputation: 69973

From my comments in your previous question:

fullCalendar has a monthNamesShort array that you can define during the declaration.

select: function(start, end, allDay) {
  if(start < date)
  {
     var shortName = this.calendar.options.monthNamesShort[start.getMonth() - 1];
     alert(shortName);
  }
},

Just access it through the calendar options.

Upvotes: 1

ace
ace

Reputation: 7583

Quick, dirty solution. Have an array of months

var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

Then get the desired full Month by deducting 1 since our array index starts with 0.

months[month.getMonth()-1]

Upvotes: 3

Related Questions