Have DateTimeWidget include the time zone in its type. #1

Merged
wathiede merged 2 commits from ggriffiniii/i3xs:master into master 2019-10-03 11:19:52 -07:00

2 Commits

Author SHA1 Message Date
de6bef6e36 More datetime changes
* Accept the format string as Into<String> rather than String to allow
  &str to be provided.
* set_colors accepts Into<Vec<TimeColor>> rather than &[TimeColor]. The
  function needs a Vec<TimeColor>. Previously it would unconditionally
  clone the slice into a Vec, now it can accept a Vec if the user provides
  one and avoid an allocation in those cases (while still cloning a slice
  if that's what the user provides).
* DateTime::colors was an Option<Vec<TimeColor>> it's now simply a
  Vec<TimeColor>. There was no difference in logic between a None and an
  empty Vec so the code could be simplified by removing the Option.
* No longer allocate a String when formatting the time.
* Collapse the logic setting color. Calculating whether to set a color
  and storing the result in Option<ColorRGB> only to then set data.color
  if the Option is Some, can be collapsed to simply set data.color if the
  configuration dictates.
2019-10-01 11:27:06 -07:00
faae3bebca Have DateTimeWidget include the time zone in its type. 2019-10-01 08:49:09 -07:00