summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/icrowley/fake/dates.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-01-11 16:57:47 +0100
committerJoram Wilander <jwawilander@gmail.com>2018-01-11 10:57:47 -0500
commit6990d052d5e95295e729aae28a0d30bfdcb98573 (patch)
treedc441fdd959997f97cfff298c833a2503cee4a37 /vendor/github.com/icrowley/fake/dates.go
parent0a9200c35d4f3c5c0462135f5f6dfe60bfe364e8 (diff)
downloadchat-6990d052d5e95295e729aae28a0d30bfdcb98573.tar.gz
chat-6990d052d5e95295e729aae28a0d30bfdcb98573.tar.bz2
chat-6990d052d5e95295e729aae28a0d30bfdcb98573.zip
[XYZ-6] Add sampledata platform command (#8027)
* Add fake dependency * [XYZ-6] Add sampledata platform command * Creating EMOJI_NAME_MAX_LENGTH as a constant and using it where needed
Diffstat (limited to 'vendor/github.com/icrowley/fake/dates.go')
-rw-r--r--vendor/github.com/icrowley/fake/dates.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/github.com/icrowley/fake/dates.go b/vendor/github.com/icrowley/fake/dates.go
new file mode 100644
index 000000000..a5e1d945a
--- /dev/null
+++ b/vendor/github.com/icrowley/fake/dates.go
@@ -0,0 +1,42 @@
+package fake
+
+// 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
+}
+
+// Year generates year using the given boundaries
+func Year(from, to int) int {
+ n := r.Intn(to-from) + 1
+ return from + n
+}