DayPilot.Duration.toString

The toString() method returns a formatted string representation of the duration.

Declaration

DayPilot.Duration.toString([pattern])

Parameters

  • pattern (string, optional) - output format string

Return Value

Returns the formatted string representation of the duration.

Notes

If pattern is not specified, the default format is days.hours:minutes:seconds.milliseconds.

The following pattern elements are supported:

  • s - seconds

  • mm - two-digit minutes (zero-padded)

  • m - minutes

  • h, H - hours

  • d - days

Example

const duration = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:30:15");
const text = duration.toString();

See Also

DayPilot.Duration Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript