Skip to content

Commit

Permalink
Removed first letters in schedule's text uppercasing
Browse files Browse the repository at this point in the history
  • Loading branch information
alordash committed Feb 1, 2021
1 parent 9a7938c commit 6e49f1b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
8 changes: 1 addition & 7 deletions lib/contexts-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ function addWordsFromContext(parsedDateIndex, index, contextsData, expressions,
if (atEnd) {
this[parsedDateIndex].string.push(...words);
} else {
if (endChar == '.') {
this[parsedDateIndex].string.unshift(...words);
let nextWordText = this[parsedDateIndex].string[1].text;
this[parsedDateIndex].string[1].text = nextWordText[0].toUpperCase() + nextWordText.substring(1);
} else {
this[parsedDateIndex].string.unshift(...words);
}
this[parsedDateIndex].string.unshift(...words);
}
result = true;
}
Expand Down
15 changes: 15 additions & 0 deletions spec/RU.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,21 @@ const stringTests = [
}
}
]
}, {
in: 'тест в foo. тест 18:30',
outs: [
{
max_date: {},
period_time: {},
string: 'тест в foo. тест',
target_date: {
isFixed: false,
isOffset: false,
hours: 18,
minutes: 30
}
}
]
}
];

Expand Down

0 comments on commit 6e49f1b

Please sign in to comment.