- Home [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
- Getting started
- Use cases
-
API
- Object types
-
Data types
- AccountType
- DynamicFieldType
- EmailType
- OrganisationStructureItemType
- PhoneType
- ReplacementType
- ServiceStatus
- UserStatus
- WatermarkPages
- WatermarkPosition
- AccountFieldTyped
- AccountFieldVoid
- ApplicationField
- Cell
- ClientEventField
- CookieOptions
- DatetimeFieldData
- DynamicBindingField
- DynamicBindingFields
- EnumField
- ErrorArgs
- ErrorObject
- FileField
- FloatFieldData
- GroupStatusField
- HttpResponse
- ImageField
- Language
- MailMessageAddress
- MailMessageAttachment
- MoneyFieldData
- Navigator
- Page
- ParseSpreadsheetOptions
- ParseSpreadsheetResponse
- RefItem
- ReportField
- ReportRef
- Role
- RoleField
- Row
- ServiceStatusInfo
- StaticApplicationFieldData
- StatusField
- TAccount
- TClientEvent
- TDate
- TDatetime
- TDuration
- TEmail
- TEnum
- TFullName
- TMoney
- TPhone
- TReport
- TStatus
- TTable
- TTime
- TTimezone
- TTimezones
- TableField
- UserField
- UserFieldData
- ValidationResult
- Watermark
- WidgetRefWithValues
- ReplacementTypeEnumBase
- RoleType
- TApplication
- TBoolean
- TCategory
- TFile
- TFloat
- TImage
- TJSON
- TLink
- TOAuth2
- TRole
- TString
- TUser
- Global constants
- Work with apps
- Web requests
- Access permissions
- Document flow
- Live Chats
- “Code” widget
- Signatures
- Business calendars
- Integration with IP telephony
- Integration with email marketing services
Time
Stores time not exceeding 24 hours. This type has the following constructors:
new TTime(): TTime; new TTime(duration: TDuration): TTime; new TTime(hours: number, minutes: number, seconds: number, milliseconds: number): TTime;
This type is immutable, so mutation methods return the updated value without changing the original one.
const time = new TTime(3, 15, 0, 0); const newTime = time.add(2, 15, 0, 0); newTime.after(time); // true
Hierarchy
Properties
Readonly hours
Number of hours.
Example:
const time = new TTime(3, 15, 0, 0); const hours = time.hours;
Readonly milliseconds
Number of milliseconds.
Example:
const time = new TTime(3, 15, 0, 0); const milliseconds = time.milliseconds;
Readonly minutes
Number of minutes.
Example:
const time = new TTime(3, 15, 0, 0); const minutes = time.minutes;
Readonly seconds
Number of seconds.
Example:
const time = new TTime(3, 15, 0, 0); const seconds = time.seconds;
Methods
add
Add time.
Example:
const time = new TTime(3, 15, 0, 0); const duration = new Duration(100, 'millisecond'); const newTime = time. add(duration);
If you set hours to more than 24, the system will subtract 24 , and the new time will be calculated starting from midnight.
Parameters
duration: TDuration
Returns TTime
after
Checks whether the specified time is later than another.
Example:
const startTime = new TTime(3, 15, 0, 0); const endTime = new TTime(5, 30, 0, 0); const after = startTime.after(endTime); // false
Parameters
time: TDatetime | TTime
Returns boolean
afterOrEqual
Checks whether the current date is the same as or later than
time
.Example:
const startTime = new TTime(3, 15, 0, 0); const endTime = new TTime(5, 30, 0, 0); const before = startTime. afterOrEqual(endTime); // false
Parameters
time: TDatetime | TTime
Returns boolean
asDatetime
Conversion to date and time.
Returns the date and time in the specified time zone or in the current one if the time zone is not specified (by default, the company’s time zone).
Example:
const time = new TTime(3, 15, 0, 0); const date = new TDate(2021, 1, 20); const datetime = time.asDatetime(date);
Parameters
date: TDate
Optional tz: TTimezone
Returns TDatetime
before
Checks whether the specified time is earlier than another.
Example:
const startTime = new TTime(3, 15, 0, 0); const endTime = new TTime(5, 30, 0, 0); const before = startTime.before(endTime); // true
Parameters
time: TDatetime | TTime
Returns boolean
beforeOrEqual
Checks whether the current date is the same as or earlier than
time
.Example:
const startTime = new TTime(3, 15, 0, 0); const endTime = new TTime(5, 30, 0, 0); const before = startTime. beforeOrEqual(endTime); // true
Parameters
time: TDatetime | TTime
Returns boolean
equal
Checks whether two time objects have the same value.
Example:
const startTime = new TTime(3, 15, 0, 0); const endTime = new TTime(5, 30, 0, 0); const equal = startTime.equal(endTime); // false
Parameters
time: TDatetime | TTime
Returns boolean
format
Coverts the time to the required format.
The default format is
HH:mm:ss
. Use the following options to format time:HH
is for hours in the 24-hour time format.hh
is for hours in the 12-hour time format.mm
is for minutes.ss
is for seconds.SSS
is for milliseconds. Example:const time = new TTime(13, 15, 0, 0); const formatTime = time.format('hh mm'); // 1pm 15
Parameters
Optional format: undefined | string
Returns string
Properties
Methods