Page 1 of 1

Blank Time Field

Posted: 2016-11-16 13:06
by thecomputerchap
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?

Re: Blank Time Field

Posted: 2016-11-22 08:48
by thecomputerchap
Anyone?? a.gneady? Still stuck on this!! :(

Re: Blank Time Field

Posted: 2016-11-23 13:08
by grimblefritz
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

Posted: 2016-11-23 14:18
by DevGiu
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?
OffTopic: Maybe this is the reason we don't read you too much this weeks ;)

Re: Blank Time Field

Posted: 2016-11-23 15:36
by grimblefritz
Indeed. Dealing with too many other issues, no time for AG lately.

Re: Blank Time Field

Posted: 2016-11-24 07:20
by thecomputerchap
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?
Hi grimblefritz,

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

Posted: 2016-11-24 16:07
by Bertv
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?

Re: Blank Time Field

Posted: 2016-12-01 13:42
by thecomputerchap
Bump!

Re: Blank Time Field

Posted: 2017-01-26 13:55
by thecomputerchap
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.