bypass the "incorect datetime value" validation for inline editor

bypass the "incorect datetime value" validation for inline editor

seth9009seth9009 Posts: 48Questions: 9Answers: 2

I'm trying to bypass an internal editor validation i think ... basically i have a date field that i want to inline edit, right now it shows "yesterday or 2 days ago or few minutes ago, etc" but i use data-date="2016-12-12" for example to inject the correct date on inline edit so the calendar works fine i can pick a new date etc, and i send the info to server, on server i do my thing and i try to return my friendly date in the format like "3 days ago, yesterday, etc" however i'm getting an "incorect datetime value" can i turn that off somehow ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    I suspect you'd need to remove the validation in whatever server-side script you are using to receive the data. I assume that is what is doing the validation?

    Allan

  • seth9009seth9009 Posts: 48Questions: 9Answers: 2

    no i'm not doing any validation, the inline editor seems to be doing something .. when i post my json back and instead of a proper date i have "3 days ago" an error will show like this "Incorrect datetime value: '3 days ago' for column 'just_a_date' at row 1"

  • seth9009seth9009 Posts: 48Questions: 9Answers: 2

    i was wondering if i could somehow turn that validation in editor off .. i could not find anything on the topic ..

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin
    Answer ✓

    What does your server-side script look like? I presume it has a validator there? That's were you would remove it. The client-side doesn't have any built in validation options - validation for Editor focuses on the server-side.

    Allan

  • seth9009seth9009 Posts: 48Questions: 9Answers: 2

    Damn i really sorry to have wasted your time on this ticket, although i don't have any validation on server side (yet) :) i do send an error to screen if mysql query does not work, and my error as that i've formatted the date to for example "3 days ago" Before i've updated mysql and of course mysql would not like "3 days ago" for day and would return that error, however on a few examples on website i've seen something like that similar for datefield and i assumed it was an editor notice/error message.

    Thanks again for sending me back to server side (because i was still looking at my datatables code) and sorry again for wasting your time on this ticket ..

  • allanallan Posts: 61,971Questions: 1Answers: 10,160 Site admin

    Not a problem. Good to hear you've tracked it down.

    Allan

This discussion has been closed.