Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

API Documentation

Documentation for developing SailfishOS applications
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Properties
  • Detailed Description

TimePicker QML Type

A clock face for selecting a time More...

Import Statement: import Sailfish.Silica 1.0
  • List of all members, including inherited members

Properties

  • hour : int
  • hourMode : enumeration
  • minute : int
  • time : date
  • timeText : string

Detailed Description

The TimePicker type enables the user to change the time within a clock-face interface.

Here is a simple time picker with its time set to 13:30 (or 1:30pm in 12-hour mode):

 import Sailfish.Silica 1.0

 TimePicker {
     hour: 13
     minute: 30
 }

If the hour or minute are not set, they default to 0.

When the user changes the time displayed by the clock face, the hour and minute properties are updated appropriately. If hourMode is set to DateTime.TwelveHours, the hour is adjusted appropriately for 12-hour mode.

For convenience, the TimePickerDialog type presents a time picker within a dialog. If you simply need to request a time value from the user, you may find it useful to present a TimePickerDialog rather than inserting a TimePicker item into your user interface.

See also TimePickerDialog and DatePicker.

Property Documentation

hour : int

The value of the hour indicator in the displayed clock face.

This is a number in the range 0-23 if hourMode is DateTime.TwentyFourHours, or in the range 0-12 if hourMode is DateTime.TwelveHours. The default value is 0.

If this is set to a number outside of the valid range according to the current hourMode, the value is adjusted to the closest value within the valid range.

See also hourMode.


hourMode : enumeration

Controls the range of values for the hour property. This may be set to one of the following:

  • DateTime.DefaultHours - Uses either 24-hour or 12-hour mode based on system settings. Default value.
  • DateTime.TwentyFourHours - 24-hour mode. The valid range for hour is 0-23.
  • DateTime.TwelveHours - 12-hour mode. The valid range for hour is 0-12.

If hourMode changes to DateTime.TwelveHours while the hour is in the range 13-23, the hour is adjusted accordingly. For example, an hour value of 14 would become 2 in 12-hour mode, since a time of "14:00 hours" is represented in 12-hour mode as "2:00pm".


minute : int

The value of the minute indicator in the displayed clock face.

This is a number in the range 0-59. The default value is 0.

If this is set to a number outside of the valid range (0-59), the value is adjusted to the closest value within the valid range.


time : date

Reports the currently selected time as a JavaScript date object.

The date of the object is set to Jan 1, 1970.


timeText : string

Reports the currently selected date as a formatted time string, in "hh:mm" format. If hourMode is DateTime.TwelveHours, an AM/PM indicator is included.

For example, if hour is 16, minute is 30 and hourMode is DateTime.TwelveHours, the timeText would be "4:30 pm". For an hourMode of DateTime.TwentyFourHours, this would be "16:30" instead.


  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn