0
$('myScheduler').scheduler('value', {
  startDateTime: '2014-03-31T03:23+02:00',
  timeZone: {
  name: 'Namibia Standard Time',
    offset: '+02:00'
  },
  recurrencePattern: 'FREQ=MONTHLY;INTERVAL=6;BYDAY=WE;BYSETPOS=3;UNTIL=20140919;'
});

*Outputs date as: 03/30/2014 in my date picker in Schedule.

Why am I getting 30 instead of 31 for day?

pkreety
  • 65
  • 9

2 Answers2

0

I do get the correct date, 03/31/2014, in the datepicker input within the scheduler with the following (I added the pound sign):

$('#myScheduler').scheduler('value', {
  startDateTime: '2014-03-31T03:23+02:00',
  timeZone: {
  name: 'Namibia Standard Time',
    offset: '+02:00'
  },
  recurrencePattern: 'FREQ=MONTHLY;INTERVAL=6;BYDAY=WE;BYSETPOS=3;UNTIL=20140919;'
});

However, due to the default datepicker behavior being "do not allow past dates," the day is crossed out on the datepicker calendar. What culture are you using with momentjs? I noticed you are looking for the ISO 8601 date format.

  • Hi I am not using any format for culture do I have to use Momentjs? and for scheduler output i mean it displays 03/30/2014 and also for end date 09/18/2014 with above input , i think this can also be timezone issue but I am not sure just started to learn dates so does timezone have any effect on display and with Start time .. ?? – pkreety Sep 02 '14 at 18:22
  • Fuel UX scheduler will try to parse your date with Javascript's built-in date parser. I would recommend using [Moment.js with locales](http://momentjs.com/#multiple-locale-support) for internationalization options. – Interactive Llama Sep 03 '14 at 19:11
  • Thank you for answer :) after adding Moment.js it fix the wrong date issue. Looks like javascript parsing has some problem but Moment.js parsing does it correctly. I have also attached the link for working fiddle as my solution [Link to JSFiddle](http://jsfiddle.net/pkreety/wt4x0f5d/10/) – pkreety Sep 05 '14 at 20:48
0

I don't know what is the problem though i got a solution to my problem by changing the format ,

$('#myScheduler').scheduler('value', {
            startDateTime: '2014/03/31T03:23+02:00',
            timeZone: {
                name: 'Namibia Standard Time',
                offset: '+02:00'
            },
            recurrencePattern: 'FREQ=MONTHLY;INTERVAL=6;BYDAY=WE;BYSETPOS=3;UNTIL=20140919;'
        });

This outputs date correctly for me seems like the problem is with date parse, but i still not sure is this the correct solution for this problem and why 2014-03-31T03:23+02:00 displays different date than 2014/03/31T03:23+02:00 ?

pkreety
  • 65
  • 9