-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DateStrCheckAge, DateStrCheckRange and DateStrCheckErrMessage
Signed-off-by: miguel <miguelpragier@gmail.com>
- Loading branch information
1 parent
0503cfb
commit a4feb74
Showing
2 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package handy | ||
|
||
func DateStrCheckErrMessage(idiom string, errCode DateStrCheck) string { | ||
if idiom == "bra" { | ||
switch errCode { | ||
case DateStrCheckErrInvalid: | ||
return "data ou formato inválido" | ||
case DateStrCheckErrOutOfRange: | ||
return "data fora do intervalo permitido" | ||
case DateStrCheckErrEmpty: | ||
return "data não definida" | ||
default: | ||
return "" | ||
} | ||
} | ||
|
||
switch errCode { | ||
case DateStrCheckErrInvalid: | ||
return "date or format invalid" | ||
case DateStrCheckErrOutOfRange: | ||
return "date out of range" | ||
case DateStrCheckErrEmpty: | ||
return "date undefined" | ||
default: | ||
return "" | ||
} | ||
} |
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