Null Date Field

Its an old problem. Even in VCL, a datefield that is null gets a date of 1899-12-30. Null is a valid value and should be displayed as blank.

In VCL, I had to override a few things to do this. Suggestions for where I should do this for XData???

I can think of some.

  1. Have a calculated field (type string) for display. I could put this in the DB or in the entities.
  2. Override some Get method in the TDataset
  3. Override some Get method in TDateField
  4. Override the DateTimePicker (or subclass it). Not sure how that interacts with HTML's input.

A date of value equals to 0 is 1899-12-31. If you want a null value, save null in the database, not 0. Use NullableDateTime type for that.

About XData, it depends on where you want to change it. You mentioned only datasets and data-aware controls. That's not XData, and you should handle it the same way you do in VCL applications.