Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1815
WinEditors and Partial Dates
posted

I have an application in which I need to be able to handle partial dates.

That is a partial dates like 09-2005 where 09 is the month and 2005 is the year.

Ideally  there would be an ability to configure a control to understand that  _ _-09-2005 = 01-09-2005 (dd-mm-yyyy) , but not display the 01 for the day. equally _ _- _ _ - 2005 would become 01-01-2005 with a flag set to 1 to indicate that only the year part is valid

I am intending to store the date in a  date column with a data validity column 1 = Year, 2 = Year and Month and 3= Year, Month and Day

Any suggestions as to the best way to handle this or do's and dont's would be grealy apprecaited.

Thank you

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    The DateTImeEditor can't handle this because it deals with dates, which require an explicitly defined day month and year.

    You can probably do this using an UltraMaskedEditor control with a regular numeric mask like "nn-nnnn", and then when it comes time to get a date out of the string value entered by the user, parse the text with a "01" inserted between the month and year, so that the value can be parsed as if it were a date.

Children