I have date fields start and end specified with a format of YYYY-MM-DD HH:mm:ss. When adding a new task, the start/end of the task are sent in as a date field and not following that format:
added task: EndDate: Tue Jul 19 2022 17:00:00 GMT-0700 (Pacific Daylight Time) {}
added task sent to server: EndDate: "2022-07-20T00:00:00.000Z"
updated task: EndDate: "2022-07-21 17:00:00"
updated task sent to server: EndDate: "2022-07-21 17:00:00"
Set your format in your model for start and end to "YYYY-MM-DD HH:mm:ss" then add a task. Sync to server and see what it sends. then edit a task and see what it sends.
Set your format in your model for start and end to "YYYY-MM-DD HH:mm:ss" then add a task. Sync to server and see what it sends. then edit a task and see what it sends.
I just changed in our advanced example, only for test purposes
export default class Task extends TaskModel {
static $name = 'Task';
static get fields() {
return [
// added this line
{name : 'startDate', format: 'MM-DD-YYYY'},
'status' // For status column
];
}
And tried to change dates. In tasks.updated[] array that send on server I see
I am using 5.1.1 not 5.1.2. The date in the changes isn't even showing in the format you show, its actually a date object not even a string. again this happens only on add. Doing changes to tasks the dates show correctly in changes array. I upgraded from the latest 5.0.x and it seems to have broke then. I am 2 weeks from release cant update to 5.1.2 yet.
I think we checked different places. Do you see Date object in JSON? Check Network>Payloads in DevTools. What format do you see?
And yes, would be nice to see the code you used. It will help to go forward here.
I am having a hard time reproducing this issue without being fully embedded in our code. However I did find that it changed between 5.0.4 and 5.0.5. Do you have a full change log for that? I am also using umd version, not sure if that differs.