Recent

Author Topic: [SOLVED] What's with the component TDBDateEdit?  (Read 1684 times)

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 445
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
[SOLVED] What's with the component TDBDateEdit?
« on: December 24, 2023, 05:47:03 pm »
I put DBDateEdit on a contacts form for the contact's DoB.  I like the button the user can bring up a calendar.
BUT, in run-time I can't figure out looking at the component's Object Inspector how to keep it from defaulting/showing on blank DoB's the values 12/30/1899 or in mine I set the Date Format to dd mmm yyyy, i.e. 30 Dec 1899. If I key in the correct DoB and save, it's correct. But every record that hasn't been edited for the DoB has this default in 1899, the first year value in the range.

Guess I'm missing something, I could write code to override that but think I'm not setting something correct in the Object Inspector.
« Last Edit: October 22, 2025, 07:43:44 pm by 1HuntnMan »

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 445
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: What's with the component TDBDateEdit?
« Reply #1 on: December 24, 2023, 05:51:07 pm »
I used this before for a date stamp in which I defaulted it to the current date. So, this issue didn't occur because I'm defaulting the current date on a new record.

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 445
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: What's with the component TDBDateEdit?
« Reply #2 on: December 24, 2023, 06:35:48 pm »
Nevermind, changed to TDBDateTimePicker. This works!

Thanks

LacaK

  • Hero Member
  • *****
  • Posts: 703
Re: [SOLVED] What's with the component TDBDateEdit?
« Reply #3 on: April 11, 2025, 06:49:18 am »
IMO TDBDateEdit should not display 12/30/1899 for NULL values (it is confusing and it doesn't look good).
I reported it as bug in https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41584

 

TinyPortal © 2005-2018