Problem

DateEditBox.CanRetainTime doesn't seem to work

Posted 1 year ago by Avatar Ralph Gucwa - Racelogic

DateEditBox has a property called CanRetainTime.  According to the documentation if it is set to true, the time portion of the bound DateTime should be preserved when we change the date.  This doesn't seem to work.

In the ViewModel I have a DateTime property.

In the View I have a DateEditBox (with CanRetainTime set to true) and a TimeEditBox, both bound to the same DateTime property.

When I change the date in the DateEditBox, the time is reset to mindnight.

 

EDIT: next week I'm going on holiday and I may be unable to respond until 10th July.

[Modified 1 year ago]


Comments (8)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA

Hi Ralph,

Thanks for letting us know.  We've fixed it for the upcoming maintenance release later this month.


Actipro Software Support
Posted 1 year ago by Ralph Gucwa - Racelogic

Fixed, but there is still a situation when it doesn't work: if you open the drop down calendar of a DateEditBox and click "today", the time of day still resets to midnight.

BTW, in my opinion clicking a day in the drop down calendar should close it.  Now when the user clicks some day (or "today"), nothing happens and he has to click somewhere outside the calendar to close it. Even double clicking doesn't close the calendar. Not very intuitive...

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA

Hi Ralph,

Good catch on the Today button.  We'll update that for the next version, which will likely be the 2017.2 version.

As for the auto-close on click.  I tend to agree that it's not ideal for a pure date picker popup right now.  The main reason it's like it is now is that for a date/time picker, we can't really close it on selection changes.  But perhaps in date-only mode, it should close? 

To confirm, it would only close on day click/Enter or pressing the Today button, right?  How about if the user clicks a day outside of the current month (where normally it would scroll to the new month)... should it close there too or stay open and scroll?


Actipro Software Support
Posted 1 year ago by Ralph Gucwa - Racelogic

A double click should definitely close the popup calendar, it's a no brainer.

With single clicks things start to be more complicated.  I didn't notice that clicking a day outside current month scrolls the calendar.  Hmmm...  Well, I think it shouldn't matter - clicking a normal day should close the calendar and clicking a day "outside" should scroll to next/previous month. It should still feel natural. Of course, I'm talking about the date-only mode, the nature of a date/time popup excludes any closing on selection.  Maybe the closing behaviour should be controlled by some property and DateTimeEditBox would set it to "don't close" and in case of DateEditBox the developer could choose his preferred behaviour?

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA

Hi Ralph,

For the next version, we will update DateEditBox clicks on popup calendar days in the current month and also Enter presses to close the popup.  Thanks for the suggestion.


Actipro Software Support
Posted 1 year ago by Ralph Gucwa - Racelogic

Fantastic!

Thanks a lot!

Posted 5 months ago by Ralph Gucwa - Racelogic

I'm refreshing the old conversation, because CanRetainTime is broken again in version 2017.2 build 0665.

1. Create two bound editors:

    <StackPanel Orientation="Vertical">
        <editors:DateEditBox Value="{Binding SimulationTime}" CanRetainTime="True"/>
        <editors:TimeEditBox Value="{Binding SimulationTime}"/>
    </StackPanel>

 SimulationTime is a DateTime property in the ViewModel.

2. Run the application

3. Change the date to any other than today

4. Change the time.

As soon as you change the time, the date gets reset to today.

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Ralph,

Thanks for letting us know.  Actually this is the opposite scenario from before since this is the TimeEditBox not retaining date.  We added code for the next build to fix that.


Actipro Software Support
Information The latest build of this product (2018.1 build 0672) was released 2 months ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.