Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » CalendarCtrl » Entering mm/dd but not year... Setting default year?
Entering mm/dd but not year... Setting default year? [message #23405] Sat, 17 October 2009 00:43 Go to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
In the program I am writing it's going to be common to enter some historical data (pilots logbook). It's also common on your paper logs to write "7/22" and then 10 pages later when the year changed from 1995 to 1996, you will see a semi crossed out entry with "1 9 9 6" written across it.

Therefore... I would like to allow entry of "7/22" (which it currently does just fine) but also set the default year. For me, the default year will be the previously entered date's year. Thus, if you are entering your backlog from 1995, you can enter 1995 the first entry then the next 50 entries can be 1/12, 2/22, 3/19, etc... and they will turn out to be 1/12/1995, 2/22/1995, etc...

I tried setting the value to Date(1995, 0, 0) but that displays 00/00/1995.

Any thoughts on making this happen? I was browsing the DateTimeCtrl.cpp source w/o much luck this far :-/

Jeremy
Re: Entering mm/dd but not year... Setting default year? [message #23442 is a reply to message #23405] Mon, 19 October 2009 22:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
That is quite reasonable requirement.

I have added "Default" method to ConvertDate (and ConvertTime) -> it is inherited to EditDate and DropDate as well.

Mirek
Re: Entering mm/dd but not year... Setting default year? [message #23443 is a reply to message #23442] Tue, 20 October 2009 02:10 Go to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Thanks, this works like a charm!

Jeremy
Previous Topic: Events to spin buttons, add mousewheel too.
Next Topic: Min and Max in DropTime
Goto Forum:
  


Current Time: Mon Sep 23 01:00:55 CEST 2019

Total time taken to generate the page: 0.16252 seconds