Formatting Dates

I have a database with plenty of ‘zero’ dates in it like this 0000-00-00 00:00:00 and like 0000-00-00

When I come to format dates, any that are ‘zero’ come out as Mon 1 Jan 1900 at 12:00 am for instance. In these cases I would rather not have a date showing but instead put some text/explanation.

If I try a ternary operation, what is the correct way to reference a ‘zero’ date?

The following works BUT not for 0000-00-00, so therefore I must know how the date is formatted in the DB.

dmx-bind:value="serverConnect.data.serverAction[0].data_modified == '0000-00-00 00:00:00' ? 'No date entered' : serverConnect.data.serverAction[0].data_modified.formatDate("ddd d MMM yyyy")"

I suppose I could set the comparison date as less than Mon 1 Jan 1900 at 12:00 am,
ie < 1900-01-01

Hope this makes sense.

Any thoughts from anybody?

Community Page
Last updated: