This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ConvertStandardDateFormatToJulianDateAndVice-versa.swift (#5516)
Description: - Added two new functions in the utility module: 1. `convertToJulianDate(dateString: String) -> String?`: Converts a standard date (yyyy-MM-dd format) to a Julian date format. Utilizes DateFormatter for parsing and Calendar for day-of-year calculation. 2. `convertFromJulianDate(julianDateString: String) -> String?`: Converts a Julian date format to a standard date (yyyy-MM-dd format). Extracts the year and day of the year from the Julian date, then constructs the standard date using Calendar. - Included error handling to manage invalid date formats and out-of-range values. - Added unit tests for both functions to validate the correctness of the conversions under various scenarios including leap years. Co-authored-by: Anandha Krishnan S <[email protected]>
- Loading branch information
515e191
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bot – ./
bot-codinasion.vercel.app
codinasion-bot.vercel.app
bot-git-master-codinasion.vercel.app
bot.codinasion.tech