1

I am using jquery datepicker to trigger year/month change for fullcalendar, it just works fine for all browsers, all PC screens and all android phones but its not working in iphones.

I have used jquery datepicker to trigger fullcalendar year/month change, here is my code

$("#myhcalendar").datepicker({
            changeMonth: true,
            changeYear: true,
            showOn: 'both',
            onChangeMonthYear: function(year, month, objDatePicker) {

                var monthnew=("0" + (month + 1)).slice(-2);
                console.log(monthnew+'-'+'10'+'-'+year);
                $('#calendar').fullCalendar('gotoDate',  monthnew-1+''+'-'+'10'+'-'+year);
                //on change of date remove event-container 
                $('.fc-content-skeleton>table tbody td').removeClass('fc-event-container');
            }
        })

myhcalendar is jquery datepicker id, and #calendar is id for fullcalendar. this works perfect in all devices except in iphone. Any suggestions?

update: just now I saw by adding alert() before $('#calendar').fullCalendar('gotoDate', monthnew-1+''+'-'+'10'+'-'+year); works but adding alert after this line does not working in iphone, there must be problem with gotodate Please comment if any other code is required to view. Thank you.

Sudarshan Kalebere
  • 3,813
  • 3
  • 34
  • 64
  • Looks like this problem is getting common. :) See [my answer](http://stackoverflow.com/questions/37504446/my-jquery-toggleclass-function-is-creating-a-hyperlink-effect-on-touchscreen-dev/37515539#37515539) (this week) on what *may be* your problem related to `.addClass()` - `.removeClass()` – Louys Patrice Bessette May 31 '16 at 05:55
  • no thats not what I need – Sudarshan Kalebere May 31 '16 at 05:57

2 Answers2

1

use (/) instead of hyphen (-)

as below

 $('#calendar').fullCalendar('gotoDate',  monthnew-1+''+'/'+'10'+'/'+year);
rashidnk
  • 4,096
  • 2
  • 22
  • 32
0

Can you try to add the following to prevent selection?

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;