1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
Bryan Austin 010c7ddbe0 Fix clocks module chronological sorting issue #98
`clock.LocalTime()` sets the location of a `time.Time` object, but
doesn't change the point in time. Since `clock.LocalTime()`
calls `time.Now()` to create the "local time", what ends up
happening is that the first `LocalTime()` is always "before" the
second one (because of the order of function calls), leading to
unstable sorting.

This change does two things to fix chronological sorting. The
first is to add a `clock.ToLocal(time.Time)` function that
acts like `clock.LocalTime()` for a given time point, so that
a single stable time point can be used throughout sorting. The
second is to do chronological sorting by comparing the string
versions of the local time, which look like (for London vs. SF):

2018-06-01 19:48:26.591550198 +0100 BST
vs.
2018-06-01 11:48:26.5915538 -0700 PDT

There may be a better way, this feels hacky-ish but works for me
on OSX.

One remaining downside is that for locations in the same time zone
(i.e. Avignon and Barcelona in the default settings), order is
determined ~randomly on startup. You could maybe append the location
to the string used for comparison to make alphabetical sorting a
fallback for equivalent times, but at least they don't jump around
anymore.
2018-06-01 23:12:34 -07:00
2018-05-24 22:01:55 -07:00
2018-05-28 21:47:26 -07:00
2018-06-01 21:06:24 +04:30
2018-05-24 22:01:55 -07:00
2018-05-28 17:19:10 -07:00
2018-04-14 07:40:55 -07:00
2018-05-31 12:29:32 -07:00

A personal terminal-based dashboard utility, designed for displaying infrequently-needed, but very important, daily data.

Quick Start

Installation from Source

Note: This has only been tested to build against Go 1.9.2. It won't work with Go versions < 1.7, and only may work on other versions.

go get github.com/senorprogrammer/wtf
cd $GOPATH/src/github.com/senorprogrammer/wtf
make install
make run

See https://wtfutil.com for the definitive documentation. Here's some short-cuts:

And a "probably up-to-date" list of currently-implemented modules:

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Authors

License

See LICENSE.md file for details.

Acknowledgments

The inspiration for WTF came from Monica Dinculescu's tiny-care-terminal.

Many thanks to Lendesk for supporting this project by providing time to develop it.

The following open-source libraries were used in the creation of WTF. Many thanks to all these developers.

Description
The personal information dashboard for your terminal
Readme 49 MiB
Languages
Go 99.1%
Makefile 0.6%
Smarty 0.2%