Skip to content

Commit

Permalink
Merge pull request #162 from moment/country-metadata
Browse files Browse the repository at this point in the history
Updates to the data:meta grunt task
  • Loading branch information
timrwood committed Dec 19, 2014
2 parents 3c2a752 + 138089d commit c3edbc2
Show file tree
Hide file tree
Showing 13 changed files with 58,459 additions and 32,038 deletions.
64 changes: 60 additions & 4 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,63 @@ Pack each zone in `data/unpacked/2014d.json` and save in `data/packed/2014d.json
"America/Phoenix|MST MDT MWT|70 60 60|01010202010|-261r0 1nX0 11B0 1nX0 SgN0 4Al1 Ap0 1db0 SWqX 1cL0"
```

### 7. Build tests for each zone.
### 7. Extract zone & country meta data

```
grunt data-meta:2014d
```

This task creates a JSON file containing list of timezones and countries. The extracted meta data can be used to list all timezones, list all countries, and filter zones by a country.

The output is saved in `data/meta/2014d.json`

Sample output:

```
{
"countries": {
"AD": {
"name": "Andorra",
"abbr": "AD",
"zones": [
"Europe/Andorra"
]
},
"AE": {
"name": "United Arab Emirates",
"abbr": "AE",
"zones": [
"Asia/Dubai"
]
},
...
},
"zones": {
"Europe/Andorra": {
"name": "Europe/Andorra",
"lat": 42.5,
"long": 1.5167,
"countries": [
"AD"
],
"comments": ""
},
"Asia/Dubai": {
"name": "Asia/Dubai",
"lat": 25.3,
"long": 55.3,
"countries": [
"AE",
"OM"
],
"comments": ""
},
...
}
}
```

### 8. Build tests for each zone.

```
grunt data-tests
Expand All @@ -170,9 +226,9 @@ For sanity, all these tasks are bundled into one task. This is the preferred way
to compile the data.

```
grunt data # run tasks 1-7 on the latest release
grunt data:2014c # run tasks 1-6 on the 2014c release
grunt data:2014d # run tasks 1-6 on the 2014d release
grunt data # run tasks 1-8 on the latest release
grunt data:2014c # run tasks 1-7 on the 2014c release
grunt data:2014d # run tasks 1-7 on the 2014d release
```


Expand Down
Loading

0 comments on commit c3edbc2

Please sign in to comment.