Editing 'created' date

SupportEditing 'created' date
Chandra asked 6 years ago
Hi Nikola,

Is there a way to change the "created" date once you change the Status from Pending to Confirmed? I also didn't find any way to do something when you "save" the appointment after editing HOOK. I was looking for a field for edited date but I couldn't find anything. Adding it also means changing the plugin. So, would love to just update the created date once you change status to confirm. Depending on that date, I am trying to send reminder emails.

Thanks.
3 Answers
Nikola Loncar Staff answered 6 years ago
Hi Chandra, there is no such hook atm. I can expose hook when user click on Confirm link, is that how status is changed in your case? Best regards, Nikola
maharzan Staff replied 6 years ago

I do it from the admin side (Editing the Appointment and selecting Confirmed). Is there a way we can change the created date when we save that?

Nikola Loncar Staff replied 6 years ago

Not atm but I can put hook there so you can override valus from appointment.

Best regards,
Nikola

maharzan Staff replied 6 years ago

Okay, I would love to have it now so I can apply my custom changes. Where and how should I add the hook and how can I update the created date? Thanks so much.

maharzan Staff answered 6 years ago
Hi Nikola,

If you can let me know where to add the hook so I can change the date on "Confirmation", that would be so much helpful. It looks like the update is done via AJAX. I do see an UPDATE case in parse_appointment() function, Is this line useful in this case? do_action('ea_edit_app', $app_data['id']);
maharzan Staff replied 6 years ago

looks like I found it.. add this line in the ajax.php, UPDATE case seems to update the date.. but will need to write a hook here.

$app_data[‘created’] = date( ‘Y/m/d H:i:s’ );

Let me know if there is a better way. I am sure there is. 🙂 Thanks a lot.

Nikola Loncar Staff answered 6 years ago
Hi Maharzan, that will do the trick but update will override those changes. I will add that hook and let you know to update solution ;) Best regards, Nikola
maharzan Staff replied 6 years ago

Cool. Thanks.