Format QML Type
Provides support for formatting numbers and datetimes in formats that are not supported by QLocale. More...
Import Statement: | import org.kde.coreaddons |
Methods
- string formatByteSize(double size, int precision)
- string formatDuration(int msecs, KFormat::DurationFormatOptions options)
- string formatRelativeDate(QDateTime date, format)
- string formatRelativeDate(date date, format)
Detailed Description
See also KFormat.
Method Documentation
Converts size from bytes to the appropriate string representation
Given a number of milliseconds, converts that to a string containing the localized equivalent, e.g. 1:23:45
string formatRelativeDate(QDateTime date, format) |
Returns a string formatted to a relative datetime style.
If the dateTime falls within one week before or after the current date then a relative date string will be returned, such as:
- Yesterday, 3:00pm
- Today, 3:00pm
- Tomorrow, 3:00pm
- Last Tuesday, 3:00pm
- Next Wednesday, 3:00pm
If the datetime falls outside this period then the format is used
Returns a string formatted to a relative date style.
If the date falls within one week before or after the current date then a relative date string will be returned, such as:
- Yesterday
- Today
- Tomorrow
- Last Tuesday
- Next Wednesday
If the date falls outside this period then the format is used