Skip to content

Commit

Permalink
docs(API): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vvo committed Sep 30, 2020
1 parent 70f5fca commit 9925f2c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
38 changes: 19 additions & 19 deletions README.md
Expand Up @@ -40,15 +40,16 @@ This method returns an array of time zones objects:
{
name: "America/Los_Angeles",
alternativeName: "Pacific Time",
abbreviation: "PST",
group: ["America/Los_Angeles"],
countryName: "United States",
continentCode: "NA",
continentName: "North America",
mainCities: ["Los Angeles", "San Diego"],
rawOffsetInMinutes: -480, // "raw" time zone offset, when there's no DST in place
rawFormat: "-08:00 Pacific Time - Los Angeles, San Diego",
currentTimeOffsetInMinutes: -420, // "current" time zone offset, this is why getTimeZones() is a method and not just an object: it can only work at runtime
countryName: "United States",
countryCode: "US",
mainCities: ["Los Angeles", "San Diego", "San Jose", "San Francisco"],
rawOffsetInMinutes: -480,
abbreviation: "PST",
rawFormat: "-08:00 Pacific Time - Los Angeles, San Diego, San Jose, San Francisco",
currentTimeOffsetInMinutes: -420, // "current" time zone offset, this is why getTimeZones() is a method and not just an object: it works at runtime
currentTimeFormat: "-07:00 Pacific Time - Los Angeles, San Diego",
},
// ...
Expand All @@ -69,14 +70,15 @@ Here's a grouping example:
{
name: "America/Dawson_Creek",
alternativeName: "Mountain Time",
abbreviation: "MST",
group: [ "America/Creston", "America/Dawson_Creek", "America/Fort_Nelson" ],
countryName: "Canada",
group: ["America/Creston", "America/Dawson_Creek", "America/Fort_Nelson"],
continentCode: "NA",
continentName: "North America",
mainCities: [ "Fort St. John", "Creston" ],
countryName: "Canada",
countryCode: "CA",
mainCities: ["Fort St. John", "Creston", "Fort Nelson"],
rawOffsetInMinutes: -420,
rawFormat: "-07:00 Mountain Time - Fort St. John, Creston",
abbreviation: "MST",
rawFormat: "-07:00 Mountain Time - Fort St. John, Creston, Fort Nelson",
currentTimeOffsetInMinutes: -420,
currentTimeFormat: "-07:00 Mountain Time - Fort St. John, Creston"
}
Expand All @@ -92,14 +94,15 @@ This is an array of time zone objects without the current time information:
{
name: "America/Los_Angeles",
alternativeName: "Pacific Time",
abbreviation: "PST",
group: ["America/Los_Angeles"],
countryName: "United States",
continentCode: "NA",
continentName: "North America",
mainCities: ["Los Angeles", "San Diego"],
countryName: "United States",
countryCode: "US",
mainCities: ["Los Angeles", "San Diego", "San Jose", "San Francisco"],
rawOffsetInMinutes: -480,
rawFormat: "-08:00 Pacific Time - Los Angeles, San Diego",
abbreviation: "PST",
rawFormat: "-08:00 Pacific Time - Los Angeles, San Diego, San Jose, San Francisco",
},
// ...
];
Expand Down Expand Up @@ -140,9 +143,6 @@ This is an array of time zone names:

```js
const value = timeZones.find((timeZone) => {
return (
dbData.timeZone === timeZone.name ||
timeZone.group.includes(dbData.timeZone)
);
return dbData.timeZone === timeZone.name || timeZone.group.includes(dbData.timeZone);
});
```
10 changes: 9 additions & 1 deletion package.json
Expand Up @@ -52,7 +52,15 @@
]
},
"prettier": {
"trailingComma": "all"
"trailingComma": "all",
"overrides": [
{
"files": "*.md",
"options": {
"printWidth": 100
}
}
]
},
"eslintConfig": {
"env": {
Expand Down

0 comments on commit 9925f2c

Please sign in to comment.