Module: index
Interfaces
- ApiResponse
- AppSettings
- CalendarDay
- CompleteHabitRequest
- CreateHabitRequest
- DaemonStatus
- GraphDataPoint
- Habit
- HabitLog
- SkipHabitRequest
- UpdateHabitLogRequest
- UpdateHabitRequest
Type Aliases
HabitStatus
Ƭ HabitStatus: "completed" | "skipped" | "missed"
Status of a habit for a given day.
completed- User marked the habit as doneskipped- User intentionally skipped (requires reason)missed- Deadline passed without completion (set by daemon)
Defined in
Functions
getCurrentDateUtc
▸ getCurrentDateUtc(): string
Returns current UTC date as YYYY-MM-DD string.
Returns
string
Defined in
getCurrentTimeUtc
▸ getCurrentTimeUtc(): string
Returns current UTC time as HH:MM string (24-hour).
Returns
string
Defined in
getTimezoneOffset
▸ getTimezoneOffset(): number
Returns user's timezone offset in minutes from UTC. Positive = east of UTC, negative = west (opposite of JS getTimezoneOffset).
Returns
number
Defined in
isValidDomain
▸ isValidDomain(domain): boolean
Validates that a string is a properly formatted domain name.
Parameters
| Name | Type | Description |
|---|---|---|
domain | string | Domain to validate (e.g., "reddit.com") |
Returns
boolean
true if valid domain format
Defined in
localTimeToUtc
▸ localTimeToUtc(localTime, timezoneOffsetMinutes): string
Converts a local time to UTC given the user's timezone offset.
Parameters
| Name | Type | Description |
|---|---|---|
localTime | string | Time in HH:MM format (24-hour, local timezone) |
timezoneOffsetMinutes | number | Offset from UTC in minutes (e.g., -300 for EST) |
Returns
string
Time in HH:MM format (24-hour, UTC)
Example
localTimeToUtc('09:00', -300) // '14:00' (EST to UTC)Defined in
utcTimeToLocal
▸ utcTimeToLocal(utcTime, timezoneOffsetMinutes): string
Converts a UTC time to local time given the user's timezone offset.
Parameters
| Name | Type | Description |
|---|---|---|
utcTime | string | Time in HH:MM format (24-hour, UTC) |
timezoneOffsetMinutes | number | Offset from UTC in minutes (e.g., -300 for EST) |
Returns
string
Time in HH:MM format (24-hour, local timezone)
Example
utcTimeToLocal('14:00', -300) // '09:00' (UTC to EST)