Our powerful JS Calendar component


Post by SHQK »

I'm using change() for listeners everytime "endTimeField" in Event Editor change,

            endTimeField: {
                listeners: {
                    change({ value, source }) {
                        console.log("endTimeField:", value)
                    }
                }
            }

But the time is correct but the date always wrong
For example, I chose today in Calendar, but the Date always Jan/01/2020
How can I fix this issue?

Attachments
date.PNG
date.PNG (39.8 KiB) Viewed 134 times

Post by saki »

These are two separate date objects: one for date part with ignored time and one for time part with ignored date. So the correct endDate is the combination of both. The correct date is calculated when you click Save.

What do you need it for? Maybe we can suggest another approach.


Post by SHQK »

saki wrote:
Wed Jun 02, 2021 2:55 pm

These are two separate date objects: one for date part with ignored time and one for time part with ignored date. So the correct endDate is the combination of both. The correct date is calculated when you click Save.

What do you need it for? Maybe we can suggest another approach.

Ya, the Date is correct when I click Save, but the Time is wrong.
I changed the endTime but it's always 1 hour from startTime

        calendar.onBeforeEventSave = ({ eventRecord }) => {
            console.log("Datetime when click save: ", eventRecord.data.endDate)
        };
Attachments
dddd.PNG
dddd.PNG (6 KiB) Viewed 119 times

Post by SHQK »

saki wrote:
Wed Jun 02, 2021 2:55 pm

These are two separate date objects: one for date part with ignored time and one for time part with ignored date. So the correct endDate is the combination of both. The correct date is calculated when you click Save.

What do you need it for? Maybe we can suggest another approach.

I need the correct DateTime ( both Date and Time ) when I change the Time to set it to my model to update later


Post by saki »

data is not a public property of the model. Use please function https://bryntum.com/docs/calendar/#Scheduler/model/EventModel#function-get, but post back please if it does not resolve the issue.

Check also also values in https://bryntum.com/docs/calendar/#Scheduler/view/Scheduler#event-beforeEventSave - this property contains new values.


Post Reply