Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: f3rno64/track-time-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.27.0
Choose a base ref
...
head repository: f3rno64/track-time-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.28.0
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Dec 17, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    48c7420 View commit details
  2. chore(release): 1.28.0

    f3rno64 committed Dec 17, 2023
    Copy the full SHA
    c503158 View commit details
Showing with 38 additions and 9 deletions.
  1. +2 −0 CHANGELOG.md
  2. +2 −2 package-lock.json
  3. +1 −1 package.json
  4. +19 −6 src/commands/list.ts
  5. +2 −0 src/options/index.ts
  6. +12 −0 src/options/yesterday.ts
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.28.0](https://github.com/f3rno64/track-time-cli/compare/v1.27.0...v1.28.0) (2023-12-17)

## [1.27.0](https://github.com/f3rno64/track-time-cli/compare/v1.26.0...v1.27.0) (2023-12-17)

## [1.26.0](https://github.com/f3rno64/track-time-cli/compare/v1.25.0...v1.26.0) (2023-12-17)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "track-time-cli",
"version": "1.27.0",
"version": "1.28.0",
"description": "A CLI utility for tracking tasks in time sheets, inspired by timetrap.",
"main": "index.js",
"repository": "https://github.com/f3rno64/track-time-cli",
25 changes: 19 additions & 6 deletions src/commands/list.ts
Original file line number Diff line number Diff line change
@@ -24,7 +24,8 @@ const COMMAND_CONFIG = {
O.HumanizeOption,
O.SinceOption,
O.TodayOption,
O.AllOption
O.AllOption,
O.YesterdayOption
])
}

@@ -35,14 +36,24 @@ interface ListCommandArgs {
all?: boolean
since?: string
today?: boolean
yesterday?: boolean
humanize?: boolean
}

const handler = (args: ListCommandArgs) => {
const { humanize, today, since, all, ago, sheets: sheetNames, db } = args

if (!_isEmpty(since) && today) {
throw new Error('Cannot use both --since and --today')
const {
yesterday,
humanize,
today,
since,
all,
ago,
sheets: sheetNames,
db
} = args

if (!_isEmpty(since) && (today || yesterday)) {
throw new Error('Cannot use --since, --today, and --yesterday together')
}

const activeSheetName = db.getActiveSheetName()
@@ -66,7 +77,9 @@ const handler = (args: ListCommandArgs) => {
? parseDate(since)
: today
? D.getStartOfDayDate()
: null
: yesterday
? D.getStartOfDayDate(new Date(Date.now() - D.getDaysMS(1)))
: null

const filteredSheets =
sinceDate === null
2 changes: 2 additions & 0 deletions src/options/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import DescriptionOption from './description'
import YesterdayOption from './yesterday'
import HumanizeOption from './humanize'
import HostnameOption from './hostname'
import SheetsOption from './sheets'
@@ -17,6 +18,7 @@ import setup from './setup'

export {
DescriptionOption,
YesterdayOption,
HumanizeOption,
HostnameOption,
DeleteOption,
12 changes: 12 additions & 0 deletions src/options/yesterday.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { type YArgsOptionDefinition } from '../types'

const YESTERDAY_OPTION: YArgsOptionDefinition = [
'yesterday',
{
describe: 'Show results from yesterday',
alias: 'y',
type: 'boolean'
}
]

export default YESTERDAY_OPTION