Tags: srishanbhattarai/nepcal
Tags
Add function to calculate total number of days spanned in current year ( #28) * Add function to calculate total number of days spanned in the current year * Create a package variable to be able to mock time in tests * Fix calculation, current month should be skipped * Add tests for total days spanned * Remove comma from test names * Use underscore naming strategy for dates in test names * Format code to put related pieces together * Create a private function to calculate total days spanned This abstracts away the implementation from TotalDaysSpanned() and we can pass our own value for time in tests.
fix: Avoid representing BS dates using time package to fix overflows (#… …24) Fixes #23 If a B.S. date (say जेठ 32) is represented as 02/32 (which was the case right now), toTime will (obviously) interpret it as Feb 32 which is an overflow by 32 - 29 = 3 days. So it's reinterpreted by the time package to be March 3 which is interpreted by nepcal to be असार 3. This is now fixed by adding a separate struct BSDate.
PreviousNext