Skip to content

Commit

Permalink
Some rework. (#4)
Browse files Browse the repository at this point in the history
* Remove packed strings - to make things simpler.
* Remove compression and bin file format - to make things simpler.
* Make the generate tool take parameters.
* Fix a many spelling mistakes.
  • Loading branch information
treeform authored May 15, 2020
1 parent 0b50447 commit 019a0fc
Show file tree
Hide file tree
Showing 22 changed files with 19,735 additions and 21,199 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
*.dll
.*
nimcache
tz/*

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,13 @@ const includeOnly: seq[string] = @[
Then just run `nimble generate`

More: https://treeform.github.io/chrono/

## Only ship the Timezones you use.

Time zone information for the whole world is slightly more then a megabyte. But for most applications support every world time zone from 1970 to 2060 is a bit much. You can easily cut down the data generated by running the generate tool:

```
generate json --startYear:2010 --endYear:2030 --includeOnly:"utc,America/Los_Angeles,America/New_York,America/Chicago,Europe/Dublin"
```

To just a couple of kilobytes. This is really important for JS backend where you ship the information to the clients.
10 changes: 4 additions & 6 deletions chrono.nimble
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Package
version = "0.1.0"
version = "0.2.0"
author = "Andre von Houck"
description = "Calendars, Timestamps and Timezones utilities."
license = "MIT"
Expand All @@ -8,14 +8,12 @@ srcDir = "src"

# Dependencies

requires "nim >= 0.17.1"
requires "zip >= 0.1.1"
requires "miniz >= 0.1.0"
requires "nim >= 1.2.0"

skipDirs = @["tests", "tools"]

task generate, "Generate timezone bins from raw data":
exec "nim c -r tools/generate"
exec "nim c -r tools/generate all"

task docs, "Generate docs":
exec "nim doc -o:docs/index.html chrono.nim"
exec "nim doc -o:docs/index.html src/chrono.nim"
Loading

0 comments on commit 019a0fc

Please sign in to comment.