Date input field with HH:mm mask

2
Is it possible to create a date input field from inside a widget which has a datetime type attribute mapped but only shows HH:mm and has just string input. A simple text input box can be created with: this.input = mxui.dom.input({'class': 'mendixFormView_textBox', 'type' : 'text', 'maxlength' : '200'}); How do I use this to create what I want? Any suggestions?
asked
5 answers
0

Mitchel, can't you use the default date picker and set the 'date format' on 'time'? Alternatively you could use this widget to pick a time instead of typing it.

answered
0

You can use a string attribute with a input mask like 00:00

answered
0

How do I put all of your suggestions into code? Input mask on a normal Mendix string input field would create situations like:

93:0

answered
0

You can use a jQuery widget like this. The are enough of them, see Calendar widget how to use jQuery in a Mendix widget. You have link it to your attribute. In the onChange event set the attribute and when the widget receives an update (look at subscribe) set the date value.

answered
0

It might be a little more logic to test, but since making the customer use a DT picker is out of the question, you could try a simple text box.

On submit of the text box you would need to so some string parsing/analysis.

Another thought is potentially two text boxes, one for hours and one for minutes.

Again, if you can use the Mendix time picker, use that instead. But if not, you can consider these options.

answered