You are viewing limited content. For full access, please sign in.

Question

Question

Default Date

asked on April 9, 2021 Show version history

Hi,

So laserfiche save empty dates as 1900-01-01,

I have date lookups that pulls dates from the database and I want empty dates to be empty, how can I write a JavaScript code that will hide the date but not the field every time the lookup date is 1900.

$('.dateHide input').on('blur'); 
  function IdValidity() {
  	if ($('.dateHide  input').val()=='1900-01-01')
     {
       $('.dateHide input').hide();
     }
     else {$('.dateHide input').show();}
   }

Thanks.

0 0

Replies

replied on April 9, 2021

I think that you want to use logic something like if input = "1/1/1900" then input = ""

So you clear the input rather than try to hide the field.

0 0
replied on April 11, 2021

HI,

 

The screenshot attached is a column in my SQL table, every time someone submits a form without POP date by default it saves "1900/01/01" even though I am expecting it to be null. It becomes a problem when another task that looks up from that table populates the fields with that default "1900/01/01". I am not sure if that makes sense. Or is there a way I can tell a workflow that saves data in the DB to say if date was empty then save null in database.

0 0
replied on April 12, 2021

This is a SQL behavior (not Laserfiche related) when you create a date field that is "NOT NULL".  Change the table to allow the date field to be null or create a view that when the POP_Date = 1900-01-01 returns NULL and query the view instead of the table.

1 0
replied on April 12, 2021

Thank you, this answered my question.

0 0
replied on April 9, 2021

Laserfiche does not save empty dates as "1900-01-01".

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.