jQWidgets Forums
jQuery UI Widgets › Forums › Getting Started › Appointment onAppointmentChange Event
Tagged: onAppointmentChange event
This topic contains 6 replies, has 2 voices, and was last updated by admin 5 years, 1 month ago.
-
Author
-
Hello jqwidgets,
I’m currently working with the jqxScheduler, and trying to update the appointment by the drag option which triggers the onAppointmentChange event with the appointment details.
here i’m trying to use the ‘from’ property which have the date value.
“event.args.appointment.from.dateData”
So, is it a correct way to have ‘form’ value?
because i have re-assigned the appointment and for the ‘form’ value i have set 11 may 2020 9 AM. but i’m getting different value.
Here is the screen shot https://i.postimg.cc/6575dJ9C/on-Change-Appointment.png
and is my sample code https://stackblitz.com/edit/github-vdfz8q
Thanks you
ShiviHello jqwidgets,
Any kind of help would be nice, looking for the solution urgently.
https://www.jqwidgets.com/community/topic/appointment-onappointmentchange-event/#post-111950
Thank you
ShiviHi Shivi,
I would suggest you to not modify appointment fields within that event as it will trigger the event again and the result will be a loop. The from and to fields expect $.jqx.date object to be set. dateData is an internal field.
Regards,
PeterI am not changing any appointment fields. I am changing the appointment time through scheduler drag and drop UI
I am getting the event from the drag and drop (onAppointmentChange).After this, I don’t know how to get the proper ‘from’ and ‘to’ date and time.
Please see my screenshot attached and stackblitz example.
Please see the highlighted date that is shown through console.log in the above screenshot.
Thanks
Hi Shivi,
The from and to fields are jqx.date objects. If you want to get Javascript object from jqx.date use from.toDate() or to.toDate().
Regards,
PeterHi Peter,
i followed your suggestion and modified my code.here is my modified sample code https://stackblitz.com/edit/github-rnaphv
but still i’m not getting the correct value of changed appointment ‘from’ and ‘to’
In below screen shot i have logged the ‘from’ value in long and string format
so,whatever date value is coming in string format i want that in a long format.Here is the screen shot https://i.postimg.cc/7P7ZvkYd/on-Change-Appointment.png
Thank you
ShiviHi Shivi,
Seems like you did not follow my suggestion. toDate() method of from and to returns Javascript Date object i.e: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date. Using the JS Date API you can format it to whatever you need.
Regards,
Peter -
AuthorPosts
You must be logged in to reply to this topic.