 # TODO Clear out debugging code, etc.
 # TODO Organize helper functions.
 # TODO Use time-based scales only for time-based data.
-# TODO The formatter transitions don't quite match the tick transitions.
 # TODO Something is breaking at the microsecond scale.
 # TODO The years scale doesn't always use the roundest numbers; it should
 # probably use a special scale.

    # While we're at it, we could probably change the name of the method as
    # well (e.g., "get_resolution_str").
    _get_resolution: (resolution, interval) ->
      r = resolution
      span = interval
      if r < 5e-4
        resol = "microseconds"
      else if r < 0.5
        resol = "milliseconds"
      else if r < 60
        if span > 60
          resol = "minsec"
        else
          resol = "seconds"
      else if r < 3600
        if span > 3600
          resol = "hourmin"
        else
          resol = "minutes"
      else if r < 24*3600
        resol = "hours"
      else if r < 30*24*3600
        resol = "days"
      else if r < 365*24*3600
        resol = "months"
      else
        resol = "years"

    else
      return tz(t, format)

  class DatetimeFormatter

    # Labels of time units, from finest to coarsest.
