Closed f3rr13r closed 5 years ago
Hi, thanks for this! Before accepting this PR we need you to provide unit tests for the new functionalities, and please rewrite your comments using the standard Swift documentation headers.
Hey there! Have followed the unit testing and documentation header conformities for the new helper methods. Let me know if there is anything else I can do to meet the criteria. Harry
Added some new methods to the moment class to assist the user in getting data about the moment instance that they have captured.
Description
NumberOfDaysInMonth() - Takes the month of the created instance and returns the number of days in the given month. Method also auto checks for the possibility of a leap year in order to determine which number of days February has.
NumberOfDaysInYear() - Takes the year of the created instance and returns the number of days in that year. Method checks the possibility of a leap year in order to determine how many days that specific year has.
IsLeapYear() - Simple helper method to determine whether or not the year that has been capture in the instance is or is not a leap year.
DaysLeftInMonth() - Takes the day of the created instance, as well as the month, and subtracts the day from the number of days in that month, returning the number of days the month has left from the moment.
Motivation and Context
Love the repo and find it really helpful, but found that an app which I am currently developing was in need of the information that these helper methods provide, so figured that others may need similar or the same functionality in the future.
How Has This Been Tested?
Testing has been done inside the project locally, but has not been scrutinized thoroughly. Will continue to test these methods for affecting factors such as time zone etc..
Types of changes
Checklist: