Hi all,
I'm trying to set a couple of blank time fields. I've ensured that the time field is not set to required in AppGini. I have then added the following flag to the timepicker jQuery in the _dml file...
defaultTime: false
When I create a new record, that field is blank. So far, so good! But when I save the record, it is placing '1:00:00 AM' into that time field in the database. It needs to stay blank (or be set to null) if the field is blank!
Any ideas please?
Blank Time Field
-
- Veteran Member
- Posts: 47
- Joined: 2016-08-28 10:37
Re: Blank Time Field
Anyone?? a.gneady? Still stuck on this!!
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Blank Time Field
I may be mis-remembering, as I haven't used AG for the past several months, but have you tried putting -1 as the default value in the AG designer?
Re: Blank Time Field
OffTopic: Maybe this is the reason we don't read you too much this weeksgrimblefritz wrote:I may be mis-remembering, as I haven't used AG for the past several months, but have you tried putting -1 as the default value in the AG designer?
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Blank Time Field
Indeed. Dealing with too many other issues, no time for AG lately.
-
- Veteran Member
- Posts: 47
- Joined: 2016-08-28 10:37
Re: Blank Time Field
Hi grimblefritz,grimblefritz wrote:I may be mis-remembering, as I haven't used AG for the past several months, but have you tried putting -1 as the default value in the AG designer?
I just tried that but it's coming up with 1:00:00:00 AM still.
I did find this in the forums, but can't work out what the SOLVED solution actually involves and have asked for some code examples. No response to that request yet and I requested some examples a few days ago. Can anyone else work out what he means?...
http://forums.appgini.com/phpbb/viewtop ... time#p6486
Cheers!
Re: Blank Time Field
What i did in my test application:
- added an field with display type 'Time' , name mas_time
- in the before_insert hook I added the following code
// set mas_time always blank
$data['mas_time'] = null;
What happens when I insert an new row in the table:
-the time field is default filled with the actual time in the detail form
- after insert the field is NULL in the database
- but in the detail form I see again the actual time in
- back to the view form I see a blank time field
Is this what happens in your application too?
- added an field with display type 'Time' , name mas_time
- in the before_insert hook I added the following code
// set mas_time always blank
$data['mas_time'] = null;
What happens when I insert an new row in the table:
-the time field is default filled with the actual time in the detail form
- after insert the field is NULL in the database
- but in the detail form I see again the actual time in
- back to the view form I see a blank time field
Is this what happens in your application too?
Bert
I am using Appgini 5.75
I am using Appgini 5.75
-
- Veteran Member
- Posts: 47
- Joined: 2016-08-28 10:37
Re: Blank Time Field
Hi all,
For the benefit of others, the only way I could fix this was to create a checkbox called 'View Time' and put some jQuery in to hide the time field when the box was unchecked.
For the benefit of others, the only way I could fix this was to create a checkbox called 'View Time' and put some jQuery in to hide the time field when the box was unchecked.