eLabSDK2.System.User

Hierarchy

  • System

    User

Methods

formatDateTime

Static formatDateTime(datetime, timezone, format?): string

format datetime given the timezone and optional datetime format.

Parameters

NameTypeDescription
datetimestringThe datetime to format.
timezonestringAn IANA timezone (e.g. Europe/Amsterdam)
format?stringA momentjs compatible datetime format. See docs

Returns

string

A formatted datetime including the time offset.


getDateFormat

Static getDateFormat(): string

Get the user's date format.

Returns

string

A string containing the user's date format.


getDateTimeFormat

Static getDateTimeFormat(): string

Get the user's date time format.

Returns

string

A string containing the user's date time format.


getSetting

Static getSetting(settingsKey): string

Get a patricular user setting based in the settings key

Parameters

NameTypeDescription
settingsKeystringthe setting key

Returns

string

the setting or undefined.


getTimeFormat

Static getTimeFormat(): string

Get the user's time format.

Returns

string

A string containing the user's time format.


getTimeZone

Static getTimeZone(): string

Get the user's timezone.

Returns

string

A string containing the user's date time format.


getUserId

Static getUserId(): number

Get the user id of the currently logged in user.

Returns

number

the user id of the currently logged in user.


getUserSettings

Static getUserSettings(): userSettingInterface[]

Get the user settings.

Returns

userSettingInterface[]

An object with user settings.


readClientSideSetting

Static readClientSideSetting<T>(settingsKey, defaultValue?): T

Read a setting from the user's local device.

Type parameters

Name
T

Parameters

NameTypeDescription
settingsKeyClientSideSettingsthe setting key.
defaultValue?T-

Returns

T

the setting or undefined.


removeClientSideSetting

Static removeClientSideSetting(settingsKey): void

Remove a setting from the user's local device.

Parameters

NameTypeDescription
settingsKeyClientSideSettingsthe setting key of the value to remove.

Returns

void

void


writeClientSideSetting

Static writeClientSideSetting(settingsKey, value): void

Write a setting to the user's local device.

Parameters

NameTypeDescription
settingsKeyClientSideSettingsthe setting key.
valueunknownthe value to store.

Returns

void

void


© 2023 eLabNext