mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-05-24 08:25:30 -04:00
Documentation for TimeSpan.
This commit is contained in:
@@ -26,7 +26,7 @@ These tags will be replaced in the template with the audiobook's values.
|
||||
| \<series\> | All series to which the book belongs (if any) | [Series List](#series-list-formatters) |
|
||||
| \<first series\> | First series | [Series](#series-formatters) |
|
||||
| \<series#\> | Number order in series (alias for \<first series[{#}]\> | [Number](#number-formatters) |
|
||||
| \<minutes\> | Duration of the audiobook in minutes | [Minutes](#minutes-formatters) |
|
||||
| \<minutes\> | Duration of the audiobook in minutes | [TimeSpan](#timespan-formatters) |
|
||||
| \<bitrate\> | Bitrate (kbps) of the last downloaded audiobook | [Number](#number-formatters) |
|
||||
| \<samplerate\> | Sample rate (Hz) of the last downloaded audiobook | [Number](#number-formatters) |
|
||||
| \<channels\> | Number of audio channels in the last downloaded audiobook | [Number](#number-formatters) |
|
||||
@@ -166,15 +166,31 @@ Text formatting can change length and case of the text. Use <#>, <#><case> or <c
|
||||
| max(#) | Only use the first # of names<br><br>Default is all names | `<author[max(1)]>` | Arthur Conan Doyle |
|
||||
| slice(#..#) | Only use entries of the names list starting from # and ending at # (inclusive)<br><br>See [Text List Formatter Usage](#Text-List-Formatters) above for details on all the variants of `slice()` | `<author[slice(..-2)]>` | Arthur Conan Doyle |
|
||||
|
||||
### Minutes Formatters
|
||||
### TimeSpan Formatters
|
||||
For more custom formatters and examples, [see this guide from Microsoft](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-timespan-format-strings).
|
||||
|
||||
| Formatter | Description | Example Usage | Example Result |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | --------------------------------- |
|
||||
| {M \| H \| D} | Format the minutes value in terms of minutes, hours and days.<br>{D:[Number_Formatter](#number-formatters) = Number of full days<br>{H:[Number_Formatter](#number-formatters) = Number of full (remaining) hours<br>{M:[Number_Formatter](#number-formatters) = Number of (remaining) minutes<br><br>Default is {M} | `<minutes[{M:4}minutes]>`<hr>`<minutes[{D:2}d {M:2}m]>`<hr>`<minutes[{D}-{H}-{M}]>` | 03000minutes<hr>02d 120m<hr>2-2-0 |
|
||||
| Formatter | Description | Example Usage | Example Result |
|
||||
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|----------------|
|
||||
| d | The "d" custom format specifier outputs the value of the TimeSpan.Days property, which represents the number of whole days in the time interval. It outputs the full number of days in a TimeSpan value, even if the value has more than one digit. If the value of the TimeSpan.Days property is zero, the specifier outputs "0".<br><br>Use "dd"-"dddddddd" for zero padding up to the specified size. | <minutes[dd]> | 02 |
|
||||
| h | The "h" custom format specifier outputs the value of the TimeSpan.Hours property, which represents the number of whole hours in the time interval that isn't counted as part of its day component. It returns a one-digit string value if the value of the TimeSpan.Hours property is 0 through 9, and it returns a two-digit string value if the value of the TimeSpan.Hours property ranges from 10 to 23.<br><br>Use "hh" for zero padding. | <minutes[hh]> | 14 |
|
||||
| m | The "m" custom format specifier outputs the value of the TimeSpan.Minutes property, which represents the number of whole minutes in the time interval that isn't counted as part of its day component. It returns a one-digit string value if the value of the TimeSpan.Minutes property is 0 through 9, and it returns a two-digit string value if the value of the TimeSpan.Minutes property ranges from 10 to 59.<br><br>Use "mm" for zero padding. | <minutes[m]> | 42 |
|
||||
| 'string' | Literal string delimiter. | <minutes[d'd 'h'h 'm'm']> | 2d 14h 42m |
|
||||
| \\ | The escape character. | <minutes[d\\d h\\h m\\m]> | 2d 14h 42m |
|
||||
|
||||
These formatters have been enhanced to allow the display of days, hours or months beyond their usual limits. For example, the total number of hours, even if it exceeds 23.
|
||||
Here, a number format is inserted for the desired part in accordance with [Microsoft’s instructions](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings). Im Unterschied zu den originären Zahlenformaten werden aber anstelle der Nullen die Buchstaben D, H oder M (Großbuchstaben) verwendet.
|
||||
|
||||
| Formatter | Description | Example Usage | Example Result |
|
||||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|-------------------|
|
||||
| D | A number format with "D" instead of "0". Using this will output the total number of days and reduce the amount of minutes avalable for "H" and "M". | <minutes[DD]> | 02 |
|
||||
| H | A number format with "H" instead of "0". Using this will output the total number of hours and reduce the amount of minutes available for "M". | <minutes[HH]> | 62 |
|
||||
| M | A number format with "H" instead of "0". Using this will output the total number of minutes. | <minutes[#,#MM]> | 3,762 |
|
||||
| D H M | A combination of the above. | <minutes[D'days 'MM'minutes']> | 02days 882minutes |
|
||||
|
||||
### Number Formatters
|
||||
|
||||
For more custom formatters and examples, [see this guide from Microsoft](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings).
|
||||
|
||||
|Formatter|Description|Example Usage|Example Result|
|
||||
|-|-|-|-|
|
||||
|\[integer\]|Zero-pads the number|\<bitrate\[4\]\><br>\<series#\[3\]\><br>\<samplerate\[6\]\>|0128<br>001<br>044100|
|
||||
|
||||
Reference in New Issue
Block a user