aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarak <[email protected]>2020-08-23 17:32:52 -0500
committerGitHub <[email protected]>2020-08-23 17:32:52 -0500
commit6332bbfbf02164f7530860680cd3232814d9fd15 (patch)
tree7987ba785f1d61218fe526a2cf13cef6cd476e25 /lib
parent8deba32a26f00606daf919c177087ef680da396b (diff)
parentb08f11c347ae4a5a39ac145ea3620fe754bb9e0d (diff)
downloadfaker-6332bbfbf02164f7530860680cd3232814d9fd15.tar.xz
faker-6332bbfbf02164f7530860680cd3232814d9fd15.zip
Merge pull request #968 from mkg0/master
Add Time Zone
Diffstat (limited to 'lib')
-rw-r--r--lib/address.js8
-rw-r--r--lib/index.js2
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/address.js b/lib/address.js
index 6ac5f9b9..125e3d50 100644
--- a/lib/address.js
+++ b/lib/address.js
@@ -373,6 +373,14 @@ function Address (faker) {
return [randomCoord[0].toFixed(4), randomCoord[1].toFixed(4)];
}
+ /**
+ * Return a random time zone
+ * @method faker.address.timeZone
+ */
+ this.timeZone = function() {
+ return faker.random.arrayElement(faker.definitions.address.time_zone);
+ }
+
return this;
}
diff --git a/lib/index.js b/lib/index.js
index c9c00d9c..764afec5 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -100,7 +100,7 @@ function Faker (opts) {
var _definitions = {
"name": ["first_name", "last_name", "prefix", "suffix", "gender", "title", "male_prefix", "female_prefix", "male_first_name", "female_first_name", "male_middle_name", "female_middle_name", "male_last_name", "female_last_name"],
- "address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "state", "state_abbr", "street_prefix", "postcode", "postcode_by_state", "direction", "direction_abbr"],
+ "address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "state", "state_abbr", "street_prefix", "postcode", "postcode_by_state", "direction", "direction_abbr", "time_zone"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb", "suffix"],
"lorem": ["words"],
"hacker": ["abbreviation", "adjective", "noun", "verb", "ingverb", "phrase"],