From 126ada14b21f62d9349756cc6a3ef835d40a3e7d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 20 Jan 2012 09:24:56 +1000 Subject: Doc: Improve Qt.locale docs. Change-Id: I3ef5c4a0bedbaa346b001852bba8e9ff9347e9e0 Reviewed-by: Andrew den Exter --- doc/src/declarative/qmldate.qdoc | 49 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'doc/src/declarative/qmldate.qdoc') diff --git a/doc/src/declarative/qmldate.qdoc b/doc/src/declarative/qmldate.qdoc index 74b3a7a3c7..82154e7424 100644 --- a/doc/src/declarative/qmldate.qdoc +++ b/doc/src/declarative/qmldate.qdoc @@ -36,16 +36,16 @@ Functions that accept a locale format may be either an enumeration value: \table - \row \i Locale.LongFormat \i The long version of day and month names; for example, returning "January" as a month name. - \row \i Locale.ShortFormat \i The short version of day and month names; for example, returning "Jan" as a month name. - \row \i Locale.NarrowFormat \i A special version of day and month names for use when space is limited; + \row \i Locale.LongFormat \i The long version of the string; for example, returning "January" as a month name. + \row \i Locale.ShortFormat \i The short version of the string; for example, returning "Jan" as a month name. + \row \i Locale.NarrowFormat \i A special version for use when space is limited; for example, returning "J" as a month name. Note that the narrow format might contain the same text for different months and days or it can even be an empty string if the locale doesn't support narrow names, so you should avoid using it for date formatting. Also, for the system locale this format is the same as ShortFormat. \endtable - or a string specifying the format: + or a string specifying the format These expressions may be used for format dates: \table \header \i Expression \i Output \row \i d \i the day as number without a leading zero (1 to 31) @@ -80,6 +80,47 @@ \row \o 'The day is' dddd \o The day is Sunday \endtable + These expressions may be used for formatting time: + + \table + \header \i Expression \i Output + \row \i h + \i the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display) + \row \i hh + \i the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display) + \row \i H + \i the hour without a leading zero (0 to 23, even with AM/PM display) + \row \i HH + \i the hour with a leading zero (00 to 23, even with AM/PM display) + \row \i m \i the minute without a leading zero (0 to 59) + \row \i mm \i the minute with a leading zero (00 to 59) + \row \i s \i the second without a leading zero (0 to 59) + \row \i ss \i the second with a leading zero (00 to 59) + \row \i z \i the milliseconds without leading zeroes (0 to 999) + \row \i zzz \i the milliseconds with leading zeroes (000 to 999) + \row \i AP or A + \i use AM/PM display. \e AP will be replaced by either "AM" or "PM". + \row \i ap or a + \i use am/pm display. \e ap will be replaced by either "am" or "pm". + \row \i t \i the timezone (for example "CEST") + \endtable + + All other input characters will be ignored. Any sequence of characters that + are enclosed in singlequotes will be treated as text and not be used as an + expression. Two consecutive singlequotes ("''") are replaced by a singlequote + in the output. + + Example format strings (assuming that the QTime is 14:13:09.042) + + \table + \header \i Format \i Result + \row \i hh:mm:ss.zzz \i 14:13:09.042 + \row \i h:m:s ap \i 2:13:9 pm + \row \i H:m:s a \i 14:13:9 pm + \endtable + + If the date is invalid, an empty string will be returned. + \sa {QtQuick2::Locale}{Locale} */ -- cgit v1.2.3 From e6b224aa2872d7d1030fa98bd30603e16f8f9604 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 20 Jan 2012 14:04:27 +1000 Subject: Update obsolete contact address. Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern Reviewed-by: Alan Alpert --- doc/src/declarative/qmldate.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/src/declarative/qmldate.qdoc') diff --git a/doc/src/declarative/qmldate.qdoc b/doc/src/declarative/qmldate.qdoc index 82154e7424..93cb8dd916 100644 --- a/doc/src/declarative/qmldate.qdoc +++ b/doc/src/declarative/qmldate.qdoc @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the documentation of the Qt Toolkit. ** -- cgit v1.2.3