Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ransome
sleek
Commits
aa5051d0
Unverified
Commit
aa5051d0
authored
Jul 12, 2021
by
Daniel Weisser
Committed by
GitHub
Jul 12, 2021
Browse files
Interpret ambigous dates - ransome1/sleek#199 (#200)
parent
0284c430
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/js/todotxtExtensions.mjs
View file @
aa5051d0
...
...
@@ -33,7 +33,7 @@ SugarDueExtension.prototype.parsingFunction = function (line) {
// Try to parse a valid date until the end of the text
for
(
var
i
=
Math
.
max
(
5
,
words
.
length
);
i
>
0
;
i
--
)
{
match
=
words
.
slice
(
0
,
i
).
join
(
"
"
);
dueDate
=
Sugar
.
Date
.
create
(
match
);
dueDate
=
Sugar
.
Date
.
create
(
match
,
{
future
:
true
}
);
if
(
Sugar
.
Date
.
isValid
(
dueDate
))
{
return
[
dueDate
,
line
.
replace
(
"
due:
"
+
match
,
''
),
Sugar
.
Date
.
format
(
dueDate
,
'
%Y-%m-%d
'
)];
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment