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

I have modified the code that will change the date format to the correct date format which js required. #56

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Sushil2308
Copy link

I have modified the code that will change the date format to the correct date format which js required.

  1. Description of Changes:

    • Clarify that the changes involve implementing two functions: extractMYD to extract and format dates, and formatDate to format the launch_date property of records.
  2. Functionality Overview:

    • extractMYD Function:
      • Purpose: Extracts year, month, and day from a date string in the format "DD-MM-YYYY" and returns it in the format "YYYY-MM-DD".
      • Input: Accepts a date string in the format "DD-MM-YYYY".
      • Output: Returns a string representing the date in the format "YYYY-MM-DD".
    • formatDate Function:
      • Purpose: Formats the launch_date property of each record in an array of records using the extractMYD function.
      • Input: An array of records, each containing a launch_date property.
      • Output: Returns an array of records with the launch_date property formatted as "YYYY-MM-DD".
  3. Error Handling:

    • Both functions implement error handling to deal with invalid date formats:
      • They check if the date string is provided and is of type string.
      • They verify if all date components (day, month, and year) are present.
      • If any error occurs, they throw an "Invalid date format" error.
  4. Testing:

    • Testing methodologies or scenarios used for validation should be included here.
    • Ensure that the functions have been tested with various date formats to ensure robustness and accuracy.
  5. Future Considerations:

    • Discuss potential enhancements or optimizations such as supporting additional date formats or optimizing performance.
    • Invite feedback from reviewers on how to further improve the codebase.
  6. Conclusion:

    • Express gratitude for the review and any feedback provided.
    • Request reviewers to merge the pull request if they find the changes satisfactory.

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

Successfully merging this pull request may close these issues.

1 participant