Blank Time Field

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
thecomputerchap
Veteran Member
Posts: 47
Joined: 2016-08-28 10:37

Blank Time Field

Post by thecomputerchap » 2016-11-16 13:06

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?

thecomputerchap
Veteran Member
Posts: 47
Joined: 2016-08-28 10:37

Re: Blank Time Field

Post by thecomputerchap » 2016-11-22 08:48

Anyone?? a.gneady? Still stuck on this!! :(

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Blank Time Field

Post by grimblefritz » 2016-11-23 13:08

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?

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: Blank Time Field

Post by DevGiu » 2016-11-23 14:18

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 ;)
/Giuseppe
Professional Outsourcing Services

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Blank Time Field

Post by grimblefritz » 2016-11-23 15:36

Indeed. Dealing with too many other issues, no time for AG lately.

thecomputerchap
Veteran Member
Posts: 47
Joined: 2016-08-28 10:37

Re: Blank Time Field

Post by thecomputerchap » 2016-11-24 07:20

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!

Bertv
Veteran Member
Posts: 65
Joined: 2013-12-11 15:59

Re: Blank Time Field

Post by Bertv » 2016-11-24 16:07

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?
Bert
I am using Appgini 5.75

thecomputerchap
Veteran Member
Posts: 47
Joined: 2016-08-28 10:37

Re: Blank Time Field

Post by thecomputerchap » 2016-12-01 13:42

Bump!

thecomputerchap
Veteran Member
Posts: 47
Joined: 2016-08-28 10:37

Re: Blank Time Field

Post by thecomputerchap » 2017-01-26 13:55

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.

Post Reply