mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
add support of 3-letter weekdays for duedate in smart syntax
This commit is contained in:
parent
28bd570436
commit
628f5ed673
1 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ class MTTSmartSyntax implements MTTSmartSyntaxInterface
|
|||
{
|
||||
protected $tagPrefix = '#';
|
||||
protected $duedatePrefix = '@!';
|
||||
protected $weekdays = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; //3-letter not present in lang
|
||||
|
||||
/** @var MTTSmartSyntaxInterface */
|
||||
protected static $instance;
|
||||
|
|
@ -102,6 +103,14 @@ class MTTSmartSyntax implements MTTSmartSyntaxInterface
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (null === $wd) {
|
||||
foreach ($this->weekdays as $idx => $weekday) {
|
||||
if ($needle === $weekday) {
|
||||
$wd = $idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null === $wd) {
|
||||
foreach ($lang->get('days_long') as $idx => $weekday) {
|
||||
if ($needle === mb_strtolower($weekday)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue