From 3d8e1d5f7e169e1eb01910be2d61eade58d16129 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Thu, 7 Apr 2022 12:50:20 +0100 Subject: [PATCH] Fix timezone issue. --- date.go | 2 +- scripts/calendar.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 scripts/calendar.sh diff --git a/date.go b/date.go index ffd9b55..fcfffd2 100644 --- a/date.go +++ b/date.go @@ -17,7 +17,7 @@ func Calendar(text string, options ...Option) (time.Time, error) { // DefaultDate returns an Option to set the date. func DefaultDate(year int, month time.Month, day int) Option { return funcOption(func(o *options) { - t := time.Date(year, month, day, 0, 0, 0, 0, time.UTC) + t := time.Date(year, month, day, 0, 0, 0, 0, time.Local) o.time = &t }) } diff --git a/scripts/calendar.sh b/scripts/calendar.sh new file mode 100755 index 0000000..a61b231 --- /dev/null +++ b/scripts/calendar.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if zenity --calendar \ +--title="Select a Date" \ +--text="Click on a date to select that date." \ +--day=10 --month=8 --year=2004 + then echo $? + else echo "No date selected" +fi \ No newline at end of file