Ticket T465772
Visible to All Users

dxDateBox - How to enable time picker

created 8 years ago

Hi,

i am trying your example to set the dateBox to display and
pick as a time picker and it show only date picker…

var now = new Date();

$("#myTime").dxDateBox({
        type: "time",
        value: now
    });

Is it a version not support ed?

Answers approved by DevExpress Support

created 8 years ago (modified 8 years ago)

Hi Gila,

In version 15.1, use the format option for this.

Updated:

The code should look as follows:

JavaScript
var now = new Date(); $("#myTime").dxDateBox({ format: "time", value: now, formatString: "HH:mm" });

I've also prepared a simple example illustrating it in action - https://jsfiddle.net/ArtemK/05um4d6c/

    Show previous comments (1)
    Artem (DevExpress Support) 8 years ago

      Hi Gila,

      The code should look as follows:

      JavaScript
      var now = new Date(); $("#myTime").dxDateBox({ format: "time", value: now, formatString: "HH:mm" });

      I've also prepared a simple example illustrating it in action - https://jsfiddle.net/ArtemK/05um4d6c/

      Let us know if this suggestion helps.

        If anyone comes across this recently, I believe that the property is now called type instead of format

        DevExpress Support Team 4 years ago

          Hello Jake,

          Thank you for your comment. You are right, we switched to the type and displayFormat properties in recent versions.

          Regards,
          Romeo

          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.