eLabSDK2.System.User
Hierarchy
-
System↳
User
Methods
formatDateTime
Static formatDateTime(datetime, timezone, format?): string
format datetime given the timezone and optional datetime format.
Parameters
| Name | Type | Description |
|---|---|---|
datetime | string | The datetime to format. |
timezone | string | An IANA timezone (e.g. Europe/Amsterdam) |
format? | string | A 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
| Name | Type | Description |
|---|---|---|
settingsKey | string | the 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
| Name | Type | Description |
|---|---|---|
settingsKey | ClientSideSettings | the 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
| Name | Type | Description |
|---|---|---|
settingsKey | ClientSideSettings | the 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
| Name | Type | Description |
|---|---|---|
settingsKey | ClientSideSettings | the setting key. |
value | unknown | the value to store. |
Returns
void
void
© 2023 eLabNext
Updated about 2 months ago