Developer forum

Forum » Feature requests » NULL/empty dates

NULL/empty dates

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

I feel I posted this before, but I can't find any record, so excuse me if this is duplicate. With both ViewModels and Tags, it would be great if DW could interpret "null"/empty dates.

 

Working with integrated data we run into some odd scenarios regarding dates and datetimes. This means that sometimes a Date is missing, but a database DateTime field is not nullable. That means that when we're doing something like GetDate("Ecom:OrderDate") we'll get back a "perceived" valid date, for example "01/01/1900"

 

We can wrap this around if statements in templates, but there are a lot of scenarios to consider:

  • A "NULL" DateTime usully returns "01/01/1900"
  • Let's assume it's a User custom field called "Last sync date", and we go to the backend and hit save and close - the UI component may prepopulate the date field with "01/01/1970"
  • I have seen some code examples where we're also looking for "01/01/0001" (not sure if it was an actual scenario OR if it still happens)
  • Some UI components setting a date to "Never" could also be "31/12/2999"

 

It would be easier for handling the templates if the developer could use a GetDate method more reliably, without having to remember and consider all of the scenarios of what "null" date can adopt.

 

Best Regards,

Nuno Aguiar


Replies