Methods
addTask(loadTaskopt) → {HTMLElement}
Adds a task to the task list upon "Add Task" button click.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
loadTask |
boolean |
<optional> |
false | Indicates whether the task is being loaded from storage. |
- Source:
Returns:
- The newly created task element.
- Type
- HTMLElement
addTask(loadTaskopt)
Adds task to task list upon "Add Task" button click. Initializes buttons within each task
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
loadTask |
boolean |
<optional> |
false |
- Source:
calendarHeader()
Creates header of the calendar.
- Source:
dateQuery()
Links calendar cell to homepage on corresponding date
- Source:
displayCalendar()
Displays the calendar for the current month.
- Source:
displayDate(date)
Updates interface with date
Parameters:
Name | Type | Description |
---|---|---|
date |
string | date in string format |
- Source:
displayJump(startYear, endYear)
Generates a dropdown for year and month selection.
Parameters:
Name | Type | Description |
---|---|---|
startYear |
number | The start year for the dropdown range. |
endYear |
number | The end year for the dropdown range. |
- Source:
displayWeek()
Updates interface with Past Week view
- Source:
formatDate() → {string}
Formats the currDate global variable into proper string display
- Source:
Returns:
- properly formatted string representing the date as "Weekday, Month Day, Year"
- Type
- string
getCompleted() → {string}
Fetch completed tasks from storage in proper format
- Source:
Returns:
tasks data in proper format
- Type
- string
getJournal() → {Object}
Get journal entry from local storage.
- Source:
Returns:
- Journal entry text in parsed json format.
- Type
- Object
getJournal() → {string}
Get journal entry from local storage
- Source:
Returns:
journal entry text in parsed json format
- Type
- string
getTasks() → {string}
Get tasks from local storage.
- Source:
Returns:
- Tasks in parsed json format or empty array if no tasks.
- Type
- string
getTasks() → {string}
Get tasks from local storage
- Source:
Returns:
tasks in parsed json format or empty array if no tasks
- Type
- string
init()
Initializes the page when the DOM content is fully loaded.
- Source:
init()
Initializes all necessary components
- Source:
initButtons()
Initializes the buttons for adding tasks, navigating months, and other functionalities.
- Source:
initButtons()
Initializes functionality of buttons
- Source:
jump(mnth, yr)
Function to jump to a specific month and year.
Parameters:
Name | Type | Description |
---|---|---|
mnth |
number | month to jump to |
yr |
number | year to jump to |
- Source:
loadAll()
Load all data from local storage
- Source:
loadCellData(cellData, currWeekDay)
Fetches data from local storage and populates Past Week view
Parameters:
Name | Type | Description |
---|---|---|
cellData |
HTMLElement | Data for specified day |
currWeekDay |
Date | Date to populate data within |
- Source:
loadCellDataTest(cellData, currCalendarMonth)
Loads cell data such as rating, productivity, and tasks for a specific date in the calendar.
Parameters:
Name | Type | Description |
---|---|---|
cellData |
HTMLElement | The table cell element to populate with data. |
currCalendarMonth |
Date | The current month being displayed in the calendar. |
- Source:
loadCompleted()
Load and populate completed tasks from local storage
- Source:
loadFromStorage(data, dateText, key) → {string|null}
Load journal entry from local storage.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Journal entry text in parsed JSON format. |
dateText |
string | Date of the journal entry in locale date string format. |
key |
string | Key to get the value from. |
- Source:
Returns:
- Value of the key in the data or null if not found.
- Type
- string | null
loadFromStorage(data, dateText, key)
Load journal entry from local storage
Parameters:
Name | Type | Description |
---|---|---|
data |
string | journal entry text in parsed json format |
dateText |
string | date of the journal entry in locale date string format |
key |
string | key to get the value from |
- Source:
loadJournal()
Load journal entry from local storage
- Source:
loadTasks()
Load tasks from local storage.
- Source:
loadTasks()
Load tasks from local storage
- Source:
loadWidgets()
Load widget ratings from local storage and update interface
- Source:
next()
Updates the global currDate to the next date and displays the next month.
- Source:
nextDate()
Updates the global currDate to the next date and updates interface
- Source:
prev()
Updates the global currDate to the previous month and displays the previous month's calendar.
- Source:
prevDate()
Updates global currDate to the previous date and updates interface
- Source:
saveCompleted(completedTaskElement)
Saves the completed tasks for a specific day.
Parameters:
Name | Type | Description |
---|---|---|
completedTaskElement |
HTMLElement | The task element that was completed. |
- Source:
saveCompleted()
Saves the completed tasks and updates Past Week view
- Source:
saveJournal()
Save journal entry to local storage
- Source:
saveTasks()
Save tasks to local storage.
- Source:
saveTasks()
Save tasks to local storage
- Source:
saveToStorage(data, dateText, key, value)
Save journal entry to local storage.
Parameters:
Name | Type | Description |
---|---|---|
data |
string | Journal entry text in parsed json format. |
dateText |
string | Date of the journal entry in locale date string format. |
key |
string | Key to store the value under. |
value |
string | Value to store. |
- Source:
saveToStorage(data, dateText, key, value)
Format journal input to be stored
Parameters:
Name | Type | Description |
---|---|---|
data |
string | journal entry text in parsed json format |
dateText |
string | date of the journal entry in locale date string format |
key |
string | key to store the value under |
value |
string | value to store |
- Source:
saveWidgets(value)
Save widgets to local storage and updates Past Week view
Parameters:
Name | Type | Description |
---|---|---|
value |
int | ID value of the widget selected |
- Source:
selectWidget(buttonIndex)
Shows that a given button has been selected by adding the active property to its classname
Parameters:
Name | Type | Description |
---|---|---|
buttonIndex |
int | the index of the button selected. |
- Source:
taskButtonsFunctionality(task)
Adds button functionality to a task upon creation.
Parameters:
Name | Type | Description |
---|---|---|
task |
HTMLElement | The task element to add functionality to. |
- Source:
taskButtonsFunctionality(task)
Adds button functionality to task upon creation
Parameters:
Name | Type | Description |
---|---|---|
task |
HTMLElement | the task to have functionality |
- Source:
taskListViewHandler()
Expands task list from collapsed state.
- Source:
taskListViewHandler()
Expands task list from collapsed state
- Source:
unselectAllCompleted()
Remove completed tasks from interface upon changing dates
- Source:
unselectAllWidgets()
Unselects all widgets by removing the active property from their classnames
- Source:
updateDateGlobals()
Updates the global date variables to the current date.
- Source:
windowWidth()
Adjusts the month header text based on the window width.
- Source: