1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

13 Commits

Author SHA1 Message Date
Bryan Austin
0656f17b80 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 12:01:34 -07:00
Chris Cummer
a62b910893 Closes #43. Add CommandRunner module to the app.
CommandRunner allows you to define a terminal command and arguments, run
it on a schedule, and view the output.

Examples:

   ping -3 cisco.com
2018-05-17 17:15:03 -07:00
Chris Cummer
9f59ee1f9f Clock is now actually a clock and not a snapshot in time 2018-05-15 13:14:35 -07:00
Chris Cummer
0ff65bbd5c Row color as common function 2018-05-14 21:04:37 -07:00
Chris Cummer
b55ca47678 Adding the site theme to git 2018-05-14 21:04:37 -07:00
Chris Cummer
da75e116c1 Fix merge conflict in todo/widget.go 2018-04-29 07:56:02 -07:00
Chris Cummer
037c90db85 Widget#focus now a thing
Widgets can inform whether or not they should get tab focus.

Widgets that provide additional functionality should return true.

Widgets that have no extra capability should return false.

This allows the FocusTracker to only tab through and focus on widgets
for which it provides value.
2018-04-28 23:41:51 -07:00
Chris Cummer
bef57d799b Rudimentary modal showing up for Todo on 'e' 2018-04-27 15:48:54 -07:00
Chris Cummer
3de253bd0d Better color config standardization. It's not just random anymore 2018-04-23 09:17:54 -07:00
Chris Cummer
6fab7c0668 Clocks are sortable 2018-04-19 09:29:49 -07:00
Chris Cummer
12ef3919dc Cleanup of stray files. Don't need so many single-use packages 2018-04-18 17:51:43 -07:00
Chris Cummer
5e186323e0 A lot of code cleanup for Clocks and Git 2018-04-18 16:57:36 -07:00
Chris Cummer
a9309ccec5 Add Clocks module 2018-04-18 15:04:10 -07:00