CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Wrong dates in BeforeShowDay on a Inline DatePicker

by zemorango » 08 Apr 2015 00:16

Hi CGdevtools Team,

I 've been trying to change the colors of some day on a datepicker, and after some testing I'm now able to do so, but there is a problem that I can't understand, on the BeforeShowDay events I have this code :

Code: Select all
function (date){
  alert(date);
  alert(date.getMonth());
}


and the months in this 2 dates alert's are diferentes for example my current date is Mars then the first alert give my the full correct date, but the second alert give me the number 2=february,

so basicly when i do some more code to mark some days with other colors, the current month is never filled with the styles I want , but only the next one.

you can try this sample for make all the day in april with some style, what I get is the days in May marked.

Code: Select all
 if (date.getMonth()==4) 
                  {           
                    return [true,'busyDay'];
                  }
                  else
                  { 
                   return [true,'normalDay'];
                  }       



Regards

José Morango
zemorango
 
Posts: 7
Joined: 01 Apr 2015 01:46

by Alexander Bulei » 08 Apr 2015 09:33

Hi Jose Morango,

and the months in this 2 dates alert's are diferentes for example my current date is Mars then the first alert give my the full correct date, but the second alert give me the number 2=february,


Its a normal behavior, please check this source

Read this section: Definition and Usage

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by zemorango » 08 Apr 2015 11:12

Thank you Alexander,
ok now I got the picture :)

But regarding the datePicker is there any event that is fired when I change the month that i'm viewing ( datepicker inline) ? because I need to calculate and mark the busy days everytime that I change the month, for the new month that I choose. What I'm trying to do is using the datepiker like and agenda with diferentes colors in the days for each month, depending of my database.
zemorango
 
Posts: 7
Joined: 01 Apr 2015 01:46

by Alexander Bulei » 08 Apr 2015 11:37

Hi Jose,

Please check our documentation: http://www.cgdevtools.com/docs/_html/IWCGJQDatePicker.TIWCGJQDatePickerOptions.htm

You need use the OnChangeMonthYear event.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to General

Who is online

Users browsing this forum: No registered users and 4 guests

Contact Us.