Adding documentation to functions.

This commit is contained in:
Lucid Kobold
2021-12-29 17:12:36 -06:00
parent 73b03afaab
commit d42ecd676e

View File

@@ -242,6 +242,10 @@ const CalenderContextProvider = ({
//TODO Update the MonthInfo to use the new month population function on first render. //TODO Update the MonthInfo to use the new month population function on first render.
//TODO Add a function that will update the MonthInfo state when the selected month changes. This should use the populate month function that will be made above. //TODO Add a function that will update the MonthInfo state when the selected month changes. This should use the populate month function that will be made above.
/**
* Updates the selectedDateInfo state when given a date.
* @param {Date} newDate The date to set the selectedDateInfo state to.
*/
const updateDateInfo = (newDate: Date) => { const updateDateInfo = (newDate: Date) => {
const output = { ...selectedDateInfo }; const output = { ...selectedDateInfo };
output.date = newDate; output.date = newDate;
@@ -252,6 +256,11 @@ const CalenderContextProvider = ({
}; };
//TODO: Add a new navigation function that will take in either a direction (next, prev) or a date to go directly to. That will update the selected month and trigger the use effects below. //TODO: Add a new navigation function that will take in either a direction (next, prev) or a date to go directly to. That will update the selected month and trigger the use effects below.
/**
* Updated the selectedDate state when given the appropriate object.
* @param {UpdateCalendarProps} input An object with year, month,
* and day keys that the selectedDate state will be updated to.
*/
const updateDate = (input: UpdateCalendarProps) => { const updateDate = (input: UpdateCalendarProps) => {
const { year, month: inputMonth, day } = input; const { year, month: inputMonth, day } = input;