-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Yinebeb-01/fix-typo-error
typo-error fixed
- Loading branch information
Showing
7 changed files
with
81 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
package ethioGrego | ||
|
||
type response struct { | ||
msg string | ||
} | ||
|
||
// returns first day of that Ethiopian year | ||
func start_day_of_ethiopian(year int) int { | ||
func startDayOfEthiopian(year int) int { | ||
//magic formula gives start of year | ||
new_year_day := (year / 100) - (year / 400) - 4 | ||
newYearDay := (year / 100) - (year / 400) - 4 | ||
|
||
//if the prev ethiopian year is a leap year, new-year occrus on 12th | ||
//if the prev ethiopian year is a leap year, new-year occurs on 12th | ||
if (year-1)%4 == 3 { | ||
new_year_day += 1 | ||
newYearDay += 1 | ||
} | ||
return new_year_day | ||
return newYearDay | ||
} | ||
|
||
// prevent incorect input | ||
// prevent incorrect input | ||
func isValid(year, month, date int) bool { | ||
inputs := []int{year, month, date} | ||
for i := range inputs { | ||
if inputs[i] <= 0 { | ||
return false | ||
} | ||
} | ||
if len(inputs) != 3 || inputs[2] > 31 || inputs[1] > 12 { | ||
return false | ||
} | ||
return true | ||
return !(len(inputs) != 3 || inputs[2] > 31 || inputs[1] > 12) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters