Home › Forums › Quform WordPress › Custom Validators
- This topic has 5 replies, 2 voices, and was last updated 8 years, 9 months ago by mtupuschies.
- AuthorPosts
- June 29, 2015 at 5:25 pm #15734mtupuschiesParticipant
Hi,
again me with an issue on the time Element. Is there a way to set the time field up so 00:00 can’t be selected? Since I use this to track time spent on tasks, rather than an hour in a day, 00:00 should not be selected.
Thanks in advance,
M
July 1, 2015 at 10:51 am #15757AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 1, 2015 at 12:24 pm #15765mtupuschiesParticipantAs usual! Great support…
Really sorry but there one thing I just realised when I checked the submissions.
I have a form which writes all the data in a database. One field also writes the date using the given variable yyyy-mm-dd
No I just realised that when someone at the East coast of the US fills in the form after 4pm their time the date submitted comes in with a day too early. For example some users submitted their form on 30/06/2015 at 5pm (us time) – in the database the date selected is already the 01/07/2015.
Is there any way I can have the date populated to the database but taking the local date of the user rather than the server location? i’d like to avoid to add a manual date selector, just for convenience.
Would be great if you have a tip.
July 1, 2015 at 12:40 pm #15767mtupuschiesParticipantFound this in the tips. And added a hidden date selector… see how this goes.
function mytheme_date_today()
{
$now = current_time('timestamp');return array(
'day' => date('j', $now),
'month' => date('n', $now),
'year' => date('Y', $now)
);
}
add_filter('iphorm_element_value_today', 'mytheme_date_today');
July 1, 2015 at 12:45 pm #15768AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 1, 2015 at 3:43 pm #15776mtupuschiesParticipantBrilliant!
Had to change:
$('.iphorm_1_1').val((new Date()).yyyymmdd());
to:
$('input[name=iphorm_1_1]').val((new Date()).yyyymmdd());
but now its working like charm. Couldn’t have done without your help!
Thanks again.
- AuthorPosts
- You must be logged in to reply to this topic.