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

DatePickerDialog QML Type

A dialog for selecting a date from a DatePicker More...

Import Statement: import Sailfish.Silica 1.0
Inherits:

Page

  • List of all members, including inherited members

Properties

  • date : date
  • dateText : string
  • day : int
  • month : int
  • year : int

Detailed Description

The DatePickerDialog type presents a DatePicker within a Dialog to enable the user to select a date using a calendar grid.

The dialog shows the currently selected date above the calendar grid. If the user accepts the dialog, the year, month, day and dateText properties are set according to the selected date; otherwise, these values are left unchanged.

Here is a simple time picker dialog, opened with PageStack::push(), with its date set to November 23, 2012:

 import QtQuick 2.2
 import Sailfish.Silica 1.0

 Button {
     id: button
     text: "Choose a date"

     onClicked: {
         var dialog = pageStack.push(pickerComponent, {
             date: new Date('2012/11/23')
         })
         dialog.accepted.connect(function() {
             button.text = "You chose: " + dialog.dateText
         })
     }

     Component {
         id: pickerComponent
         DatePickerDialog {}
     }
 }

Note that if the date property is not set or is set to undefined, the dialog will show a year selection page when it opens.

The DatePickerDialog provides a convenient way to request a date value from the user through a dialog-type interface. If you require the calendar grid interface without the dialog container, use DatePicker instead.

See also TimePicker, DatePicker, and Dialog.

Property Documentation

date : date

The accepted date, as a JavaScript date object. This defaults to the current local date.

Note that a JavaScript date object's month value is 0-based. See DatePicker::date for more information.

See also DatePicker::date.


[read-only] dateText : string

Reports the accepted date as a formatted date string in the system short date format.

See also DatePicker::dateText.


[read-only] day : int

Reports the day of the accepted date, as a number in the range 1-31.

See also DatePicker::day.


[read-only] month : int

Reports the month of the accepted date, as a number in the range 1-12.

See also DatePicker::month.


[read-only] year : int

Reports the year of the accepted date, as a four-digit number.

See also DatePicker::year.


  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn