Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Wrong JS regex for date-time field

[FIXED] Wrong JS regex for date-time field 10 Aug 2012 02:59 #3083

  • schartier
  • schartier's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
Hi,

First of all I must thank you for providing such a great tool... for so cheap! It's my first project in J-Cook but I am very exited about all the possibilites your application offers (and all the time I will save)!

What I would like to know is how to configure a table date-time field to be required, with default value 0000-00-00 00:00:00 . The "Preview and test" from field parameters says "Incorrect value" with the following configuration:
Required: yes
Default value: 0000-00-00 00:00:00
Prefil form: no

Date format: inherit, inherit  OR  yyyy-mm-dd HH:MM:SS
Unix format: yes OR no

Preview and test: 0000-00-00 00:00:00


Thanks in advance,

:silly: Sebastien
Last Edit: 14 Oct 2012 12:50 by admin.
The administrator has disabled public write access.

Re: Default value for date-time field 10 Aug 2012 03:16 #3084

  • schartier
  • schartier's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
schartier wrote:
Hi,

First of all I must thank you for providing such a great tool... for so cheap! It's my first project in J-Cook but I am very exited about all the possibilites your application offers (and all the time I will save)!

What I would like to know is how to configure a table date-time field to be required, with default value 0000-00-00 00:00:00 . The "Preview and test" from field parameters says "Incorrect value" with the following configuration:
Required: yes
Default value: 0000-00-00 00:00:00
Prefil form: no

Date format: inherit, inherit  OR  yyyy-mm-dd HH:MM:SS
Unix format: yes OR no

Preview and test: 0000-00-00 00:00:00


Thanks in advance,

:silly: Sebastien

After reflexion, I guess it will work anyway. I know that 0000-00-00 00:00:00 is not a good date in php so the value won't be good when entered. But on the db side it should work.

Please confirm, Sébastien.
The administrator has disabled public write access.

Re: Default value for date-time field 10 Aug 2012 18:07 #3092

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Don't know about the time format, but if you want to have a default value in the field, you should check the Prefill form box
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 09:58 #3226

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 415
  • Thank you received: 131
  • Karma: 47
HI There
It seems i am experiencing similar issue

If i set the date format for the my_date_time field type to yyyy-mm-dd and HH:MM

if i enter in the validator tester the following

Date Format => yyyy-mm-dd and HH:MM value => 2012-12-12 10:00 = Incorrect Value
Date Format => yyyy-mm-dd and HH:MM value => 2012-12-12 = Pass

Also it appears that the validator tester for time field type is not working on my end
- type in any value regardless of setting -> not getting pass or fail

Thanks in advance
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 10:26 #3229

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
I have just changed something now.

Can you give a new try ?

CHANGED :
in dom : html.form.input
means (dom/html/form/input.php)


EDIT
\s in Javascript is treated as unicode
\d isn't, which means only ASCII digits (0-9) are accepted.
Coding is now a piece of cake
Last Edit: 21 Aug 2012 10:28 by admin.
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 12:17 #3231

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 415
  • Thank you received: 131
  • Karma: 47
Thanks Admin,
Have refreshed cache, and rebuilt project
sorry to report still same result - validation test fails in the properties box of builder with the following

Date Format => yyyy-mm-dd and HH:MM value => 2012-12-12 10:00 = Incorrect Value
Date Format => yyyy-mm-dd and HH:MM value => 2012-12-12 = Pass

Date Format => yyyy-mm-dd and HH:MM:SS value => 2012-12-12 10:00:00 = Incorrect Value
Date Format => yyyy-mm-dd and HH:MM value => 2012-12-12 = Pass

Date Format => inherit and inherit value => 2012-12-12 10:00 = Incorrect Value
Date Format => inherit and inherit value => 2012-12-12 10:00:00 = Incorrect Value
Date Format => inherit and inherit value => 2012-12-12 = Incorrect Value
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 12:28 #3232

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Can you dump the regex of the first case ?
(Generated JS regex. Check the source of the page)

Did your regex contain \d or \s ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 12:47 #3233

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 415
  • Thank you received: 131
  • Karma: 47
Sorry Admin
- I was working in the builder properties box
- I can confirm that it is now working in sandbox layout

But...
The same issue persists in the builder properties box - the above fails when entered in to the Preview and test input
Last Edit: 21 Aug 2012 12:48 by BTB300.
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 13:35 #3235

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Ok.

Fixed now also in the builder.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Default value for date-time field -validation? 21 Aug 2012 15:28 #3237

  • BTB300
  • BTB300's Avatar
  • Online
  • Moderator
  • Posts: 415
  • Thank you received: 131
  • Karma: 47
Thankyou
- Can confirm working in builder as well after closing builder and clearing cache and reopening builder
Last Edit: 21 Aug 2012 15:28 by BTB300.
The administrator has disabled public write access.
Time to create page: 0.126 seconds

Get Started