Skip to content

Commit

Permalink
Merge pull request #116 from bradymholt/fix/105
Browse files Browse the repository at this point in the history
Fix verbose DOW specified with * DOM
  • Loading branch information
bradymholt authored Jun 25, 2019
2 parents 2f630dc + b73df0c commit 68bad2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/expressionDescriptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ export class ExpressionDescriptor {
let offSetDays = lastDayOffSetMatches[1];
description = StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(), offSetDays);
break;
} else if (expression == "*" && this.expressionParts[5] != "*"){
// * dayOfMonth and dayOfWeek specified so use dayOfWeek verbiage instead
return "";
} else {
description = this.getSegmentDescription(
expression,
Expand Down
4 changes: 4 additions & 0 deletions test/cronstrue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ describe("Cronstrue", function() {
it("30 4 1 * *", function() {
assert.equal(construe.toString(this.test.title, { verbose: true }), "At 04:30 AM, on day 1 of the month");
});

it("0 13 * * 1", function() {
assert.equal(construe.toString(this.test.title, { verbose: true}), "At 01:00 PM, only on Monday");
});
});

describe("errors", function() {
Expand Down

0 comments on commit 68bad2f

Please sign in to comment.