Thursday, April 25, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1125  / 2 Years ago, tue, may 17, 2022, 11:26:34

According to the API I should use date property, but with mode: "Hours|Minutes" the picker stays at 00:00. Is it possible somehow?


More From » application-development

 Answers
2

You can use a simple JavaScript Date Object to set a default value:



import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.Pickers 0.1

DatePicker {
id: timePicker
mode: "Hours|Minutes"
date: new Date(0,0,0,8,5)
}


The Date object is used to work with dates and times.



Date objects are created with new Date().



There are four ways of instantiating a date:



var d = new Date();
var d = new Date(milliseconds);
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);

[#26054] Thursday, May 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inaterested

Total Points: 500
Total Questions: 104
Total Answers: 92

Location: Virgin Islands (U.S.)
Member since Fri, May 7, 2021
3 Years ago
inaterested questions
Fri, Aug 12, 22, 21:24, 2 Years ago
Wed, Apr 27, 22, 17:14, 2 Years ago
Tue, Oct 26, 21, 20:41, 3 Years ago
;