-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
121 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package fake | ||
|
||
// Currency generates currency name | ||
func Currency() string { | ||
return lookup(lang, "currencies", true) | ||
} | ||
|
||
// CurrencyCode generates currency code | ||
func CurrencyCode() string { | ||
return lookup(lang, "currency_codes", true) | ||
} |
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,38 +1,42 @@ | ||
package fake | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// Day generates day of the month | ||
func Day() int { | ||
return r.Intn(31) + 1 | ||
} | ||
|
||
// WeekDay generates name ot the week day | ||
func WeekDay() string { | ||
return lookup(lang, "weekdays", true) | ||
} | ||
|
||
// WeekDayShort generates abbreviated name of the week day | ||
func WeekDayShort() string { | ||
return lookup(lang, "weekdays_short", true) | ||
} | ||
|
||
// WeekdayNum generates number of the day of the week | ||
func WeekdayNum() int { | ||
return r.Intn(7) + 1 | ||
} | ||
|
||
// Month generates month name | ||
func Month() string { | ||
return lookup(lang, "months", true) | ||
} | ||
|
||
// MonthShort generates abbreviated month name | ||
func MonthShort() string { | ||
return lookup(lang, "months_short", true) | ||
} | ||
|
||
// MonthNum generates month number (from 1 to 12) | ||
func MonthNum() int { | ||
return r.Intn(12) + 1 | ||
} | ||
|
||
func Year(fromOffset, toOffset int) int { | ||
n := r.Intn(fromOffset+toOffset) + 1 | ||
return (time.Now().Year() - fromOffset) + n | ||
// Year generates year using the given boundaries | ||
func Year(from, to int) int { | ||
n := r.Intn(to-from) + 1 | ||
return from + n | ||
} |
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
Oops, something went wrong.