Skip to content

Commit

Permalink
RelativeDate: Rename 'now' to 'today'
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Jul 20, 2024
1 parent 68f5e89 commit f7b1473
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tl/tt/rel_date.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func RelativeDate(currentTime time.Time, relativeDateLabel string) (time.Time, e
dowOffset := -1
nextFlag := false
switch relativeDateLabel {
case "now":
case "today":
// default
case "":
// equiv to "now"
// equiv to "today"
case "sunday":
dowOffset = 0
case "monday":
Expand Down
6 changes: 3 additions & 3 deletions tl/tt/rel_date_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestRelativeDate(t *testing.T) {
expectError bool
}{
{
name: "empty (now, default UTC)",
name: "empty (today, default UTC)",
whenLocal: defaultUtc,
expect: "2024-07-16T01:30:00Z",
},
Expand All @@ -42,8 +42,8 @@ func TestRelativeDate(t *testing.T) {
expect: "2024-07-16T10:00:00-07:00",
},
{
name: "now with tz",
dateLabel: "now",
name: "today with tz",
dateLabel: "today",
whenLocal: defaultLocal,
expect: "2024-07-15T10:00:00-07:00",
},
Expand Down

0 comments on commit f7b1473

Please sign in to comment.