Skip to content

Commit fa84603

Browse files
fix: fix date inputs
1 parent 3fd3383 commit fa84603

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/arguments/ArgsParser.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class ArgsParser {
2525
this.cli.r(longOpt: 'random-seed', args: 1,
2626
argName: 'seed', 'Random seed used for shuffling merge commits array')
2727
this.cli.s(longOpt: 'since', args: 1,
28-
argName: 'date', 'Use commits more recent than a specific date (format DD/MM/YYY)')
28+
argName: 'date', 'Use commits more recent than a specific date (format YYYY-MM-DD)')
2929
this.cli.u(longOpt: 'until', args: 1,
30-
argName: 'date', 'Use commits older than a specific date(format DD/MM/YYYY)')
30+
argName: 'date', 'Use commits older than a specific date(format YYYY-MM-DD)')
3131
this.cli.m(longOpt: 'max-commits-per-project', args: 1,
3232
argName: 'commits', 'Maximum number of commits to use for each project. Commits will be selected randomly, according to provided random seed')
3333
this.cli.i(longOpt: 'injector', args: 1,
@@ -88,14 +88,14 @@ class ArgsParser {
8888

8989
if (this.options.since) {
9090
if (!validDate(this.options.since))
91-
throw new InvalidArgsException('Invalid since date. You must specify it with the format DD/MM/YYYY')
91+
throw new InvalidArgsException('Invalid since date. You must specify it with the format YYYY-MM-DD')
9292

9393
args.setSinceDate(this.options.since)
9494
}
9595

9696
if (this.options.until) {
9797
if (!validDate(this.options.until))
98-
throw new InvalidArgsException('Invalid since date. You must specify it with the format DD/MM/YYYY')
98+
throw new InvalidArgsException('Invalid until date. You must specify it with the format YYYY-MM-DD')
9999

100100
args.setUntilDate(this.options.until)
101101
}
@@ -156,7 +156,7 @@ class ArgsParser {
156156
}
157157

158158
private boolean validDate(String value) {
159-
SimpleDateFormat format = new SimpleDateFormat("dd/mm/yyyy")
159+
SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd")
160160
try {
161161
format.setLenient(false)
162162
format.parse(value)

src/main/project/Project.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Project {
110110
}
111111

112112
private Process constructAndRunGitLog(String sinceDate, String untilDate) {
113-
ProcessBuilder gitLogBuilder = ProcessRunner.buildProcess(path, 'git', '--no-pager', 'log', '--merges', '--pretty=%H-%p', '--date=format:\'%d/%m/%Y\'')
113+
ProcessBuilder gitLogBuilder = ProcessRunner.buildProcess(path, 'git', '--no-pager', 'log', '--merges', '--pretty=%H-%p')
114114
if(!sinceDate.equals(''))
115115
ProcessRunner.addCommand(gitLogBuilder, "--since=\"${sinceDate}\"")
116116
if(!untilDate.equals(''))

0 commit comments

Comments
 (0)