Skip to content

Latest commit

 

History

History
268 lines (154 loc) · 4.43 KB

Time.md

File metadata and controls

268 lines (154 loc) · 4.43 KB

Class: Time

Class to use to describe a time duration.

Example

@Property({
    displayName: 'Remaining time',
    description: 'Remaining time before the end.',
    defaultValue: Time.Zero,
    type: Time
})
public remainingTime: Time;

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Time(hours, minutes, seconds)

Create a new time with given hours, minutes and seconds.

Parameters

Name Type Description
hours number hours of the time
minutes number minutes of the time
seconds number seconds of the time

Properties

Zero

Static Readonly Zero: Time

Instance of time representing an empty duration of zero.


One

Static Readonly One: Time

Instance of time representing a duration of 1 second.


strTime

Readonly strTime: string

Time in string format


strTimeWithoutMilliseconds

Readonly strTimeWithoutMilliseconds: string

Time in string format without milliseconds


totalSeconds

Readonly totalSeconds: number

Total time in seconds including ms


totalIntegerSeconds

Readonly totalIntegerSeconds: number

Total time in seconds without ms


totalMilliseconds

Readonly totalMilliseconds: number

Total time in ms


hours

Readonly hours: number

hours of the time


minutes

Readonly minutes: number

minutes of the time


seconds

Readonly seconds: number

seconds of the time

Methods

convertFrom

Static convertFrom(value): Time

Convert a value to a Time

Parameters

Name Type Description
value unknown Value can be converted from string or number. If string, it's parsed with the format hh:mm:ss.ms. If number, it's considered as a number of seconds.

Returns

Time


canConvertFrom

Static canConvertFrom(value): boolean

Check if we can convert value to Time

Parameters

Name Type
value unknown

Returns

boolean


fromSeconds

Static fromSeconds(value): Time

Convert from seconds to time

Parameters

Name Type
value number

Returns

Time


toString

toString(withoutMilliseconds?): string

Convert time to string

Parameters

Name Type Default value Description
withoutMilliseconds boolean false show milliseconds in string result

Returns

string

Implementation of

IConvertibleType.toString


canConvertTo

canConvertTo(type): boolean

Check if the type can be converted

Parameters

Name Type
type unknown

Returns

boolean

Implementation of

IConvertibleType.canConvertTo


convertTo

convertTo(type): unknown

Function to convert a Time to another type

Parameters

Name Type
type unknown

Returns

unknown

Implementation of

IConvertibleType.convertTo

Help

Found a problem, a bug? Or need some help?
Please do not create an issue in Github! Ask us via our Support page : https://support.intuiface.com/