From 331df4881af5b263f79be87f2133f14cb027e195 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 27 Nov 2013 10:35:23 +0000 Subject: [PATCH] EditDateTime: Support for DayEnd git-svn-id: svn://ultimatepp.org/upp/trunk@6611 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/DateTimeCtrl.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/uppsrc/CtrlLib/DateTimeCtrl.h b/uppsrc/CtrlLib/DateTimeCtrl.h index 2a989d91a..51f6c936a 100644 --- a/uppsrc/CtrlLib/DateTimeCtrl.h +++ b/uppsrc/CtrlLib/DateTimeCtrl.h @@ -428,7 +428,16 @@ class DateTimeCtrl : public T { int mode; void OnCalendarChoice() { - this->SetData(~cc.calendar); + Date dt = ~cc.calendar; + ConvertTime *cv = dynamic_cast(this); + if(cv && cv->IsDayEnd()) { + Time tm = ToTime(dt); + tm.hour = 23; + tm.minute = tm.second = 59; + this->SetData(tm); + } + else + this->SetData(dt); this->WhenAction(); }