hubot-scripts/hubot-ingress — pull request #8 by drstevens (2014-11-21 21:10:37+00:00)
Title: Add support for setting timezone names in addition to offset

When I originally tried to deploy cycle calculator, I attempted to use timezone name instead of offset. This obviously didn't work. After configuring offset and including `Z` in the formatter, the feedback I got was that people wanted to see time with `EST` opposed to `-05:00`. Additionally, the offset command response was awkward when the offset was configured via env variable. e.g. `Current timezone offset is -04:00 minutes.`

I changed the dependency from moment.js to moment-timezone.js and added support for configuring `HUBOT_CYCLE_TZ_NAME` in addition to `HUBOT_CYCLE_TZ_OFFSET`. Name wins if both are provided. If none is provided, the server offset is used. This change allows you to use `z` in the time formatter. Another benefit to configuring timezone name is that DST changes are automatically handled by moment-timezone opposed to requiring someone to change the env variable manually.

With `HUBOT_CYCLE_TZ_NAME="EST"` and HUBOT_CYCLE_TIME_FMT="ddd hA z"
> Current timezone offset is EST.
> The next 1 cycle(s) occur at: Mon 6PM EST.

With `HUBOT_CYCLE_TZ_NAME` unset and `HUBOT_CYCLE_TIME_FMT="ddd hA z"`
> Current timezone offset is +00:00.
> The next 1 cycle(s) occur at: Mon 11PM UTC.

With `HUBOT_CYCLE_TZ_OFFSET="-01:00"`, `HUBOT_CYCLE_TZ_NAME` unset and `HUBOT_CYCLE_TIME_FMT="ddd hA"`
> Current timezone offset is -01:00.
> The next 1 cycle(s) occur at: Mon 10PM.