use local timezone in client, utc timezone on server. should close #31

This commit is contained in:
Danny 2018-05-16 03:54:51 -05:00
parent fc552b0508
commit 0caf52b780
2 changed files with 6 additions and 3 deletions

View File

@ -38,11 +38,11 @@ class DatePicker extends Component {
@bind
setTimeRange(period) {
let beforeDate = new Date();
beforeDate.setUTCHours(24);
beforeDate.setHours(24);
beforeDate.setMinutes(0);
let afterDate = new Date();
afterDate.setUTCHours(0);
afterDate.setHours(0);
afterDate.setMinutes(0);
switch(period) {
case "week":

View File

@ -18,6 +18,10 @@ type App struct {
var app *App
func main() {
// force all times in UTC, regardless of server timezone
os.Setenv("TZ", "")
// setup CLI app
app = &App{cli.NewApp(), nil, nil}
app.Name = "Fathom"
app.Usage = "simple & transparent website analytics"
@ -70,7 +74,6 @@ func main() {
func before(c *cli.Context) error {
app.config = config.Parse(c.String("config"))
app.database = datastore.New(app.config.Database)
return nil
}