Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress Documentation | JSDOC #1927

Open
scottqueen-bixal opened this issue Nov 12, 2024 · 0 comments
Open

Cypress Documentation | JSDOC #1927

scottqueen-bixal opened this issue Nov 12, 2024 · 0 comments
Assignees
Labels
V1 Final V1 handoff work

Comments

@scottqueen-bixal
Copy link
Collaborator

Description

Provide JSDOC documentation for our functions and test

https://jsdoc.app/

for example:

/**
 * Returns a date object with the specified offset added to the current date.
 * @param {number} offset - The number of days to add to the current date.
 * @returns {Object} An object containing the month, day, and year.
 * @example
 * getDateByOffset(10); // returns { month: "05 - May", day: "25", year: 2023 }
 */
export function getDateByOffset(offset) {
  const date = new Date(Date.now());
  const n = Number(offset);

  date.setDate(date.getDate() + n);
  const month = ('0' + (date.getMonth() + 1)).slice(-2);
  const monthName = date.toLocaleString('default', { month: 'long' });
  const day = ('0' + date.getDate()).slice(-2);
  const year = date.getFullYear();

  return { month: month + ' - ' + monthName, day, year };
}

User Story

No response

Acceptance Criteria

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V1 Final V1 handoff work
Projects
None yet
Development

No branches or pull requests

2 participants