Namespace Deluge.Formatters
Deluge.Formatters
Defined in: Deluge.Formatters.js.
Constructor Attributes | Constructor Name and Description |
---|---|
A collection of functions for string formatting values.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
Deluge.Formatters.date(timestamp)
Formats a date string in the locale's date representation based on the
systems timezone.
|
<static> |
Deluge.Formatters.plain(value,)
Simply returns the value untouched, for when no formatting is required.
|
<static> |
Deluge.Formatters.size(bytes)
Formats the bytes value into a string with KiB, MiB or GiB units.
|
<static> |
Deluge.Formatters.speed(bytes)
Formats a string to display a transfer speed utilizing Deluge.Formatters.size
|
<static> |
Deluge.Formatters.timeRemaining(time)
Formats a string to show time in a human readable form.
|
Method Detail
<static>
{string}
Deluge.Formatters.date(timestamp)
Formats a date string in the locale's date representation based on the
systems timezone.
- Parameters:
- {number} timestamp
- time in seconds since the Epoch
- Returns:
- {string} a string in the locale's date representation or "" if seconds < 0
<static>
Deluge.Formatters.plain(value,)
Simply returns the value untouched, for when no formatting is required.
- Parameters:
- value,
- the value to be displayed
- Returns:
- the untouched value.
<static>
{string}
Deluge.Formatters.size(bytes)
Formats the bytes value into a string with KiB, MiB or GiB units.
- Parameters:
- {number} bytes
- the filesize in bytes
- Returns:
- {string} formatted string with KiB, MiB or GiB units.
<static>
{string}
Deluge.Formatters.speed(bytes)
Formats a string to display a transfer speed utilizing Deluge.Formatters.size
- Parameters:
- {number} bytes
- the filesize in bytes
- Returns:
- {string} formatted string with KiB, MiB or GiB units.
<static>
{string}
Deluge.Formatters.timeRemaining(time)
Formats a string to show time in a human readable form.
- Parameters:
- {number} time
- the number of seconds
- Returns:
- {string} a formatted time string. will return '' if seconds == 0