Home Unanswered Active Tags New Question

Daypilot Schedular not working with Gaia --- URGENT

Hi...

If you have any gaia web widgetscontrol on a page with Daypilot schedular, the daypilot schedular does not work...

e.g. Event move, event resize, navigation into next/previous day, zoom, etc. all causebelow error to appear on the page in a message box.

An exception was thrown in the server-side event handler:

System.FormatException: String was not recognized as a valid DateTime.

........

If we just remove the gaia control, everyting works just fine.

I am working with Daypilot version 5.1 SP1

Asked by Kedar 3 years ago.
Replies

It seems that it's because Gaia defines Date.prototype.toJSON function. DayPilot does the same but the format is not compatible. I'm looking for a way to fix it.

Comment posted by Dan Letecky 3 years ago.

Thanks...

When can we expect the fix?

We are on a very tight schedule and need to evaluate the feasibility of our solution before moving forward.

Comment posted by Kedar 3 years ago.

I found out that it's Gaia which is incompatible here. It uses the following definition:

Date.prototype.toJSON = function() {
  return '"' + this.getUTCFullYear() + '-' +
  (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
  this.getUTCDate().toPaddedString(2) + 'T' +
  this.getUTCHours().toPaddedString(2) + ':' +
  this.getUTCMinutes().toPaddedString(2) + ':' +
  this.getUTCSeconds().toPaddedString(2) + 'Z"';
};

The definition from json.org is as follows:

Date.prototype.toJSON = function (key) {
  function f(n) {
    // Format integers to have at least two digits.
    return n < 10 ? '0' + n : n;
  }

  return this.getUTCFullYear()   + '-' +
    f(this.getUTCMonth() + 1) + '-' +
    f(this.getUTCDate())      + 'T' +
    f(this.getUTCHours())     + ':' +
    f(this.getUTCMinutes())   + ':' +
    f(this.getUTCSeconds())   + 'Z';
  };

I will now rename the Date.prototype.toJSON function inside DayPilot as a quick fix. Please contact me at support@daypilot.org so I can send it to you.

In the next release, I would like to get rid of the Date.prototype modifications at all to be absolutely clean.

Comment posted by Dan Letecky 3 years ago.

Thanks.

That was great. I have sent you an email regarding the same.

Regards and best wishes.

Comment posted by Kedar 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java