Ticket T604190
Visible to All Users

DateBox - How to set min and max time

created 7 years ago

Hi, everybody.

Please tell me how I can set the minimum and maximum values for the datepicker element?

C#
@(Html.DevExtreme().DateBox() .Type(DateBoxType.Time) .PickerType(DateBoxPickerType.List) .Max(......) .Min(......) .Value(DateTime.Now) )

I need to allow time to be selected in the range from 7 to 21 hours in 10 minute increments.

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

Hello Sergey,

For the "time" picker, set the dxDateBox.min and dxDateBox.max options as shown below:

ASPx
@(Html.DevExtreme().DateBox() .Type(DateBoxType.Time) .PickerType(DateBoxPickerType.List) .Max(DateTime.Now.AddHours(5)) .Min(DateTime.Now) .Interval(10) .Value(DateTime.Now) )
    Comments (1)
    SN SN
    Sergey Novikov 5 7 years ago

      Thank you, Marion.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.