mirror of
https://github.com/brmlab/dokuwiki-plugin-nextday.git
synced 2025-08-02 16:03:36 +02:00
implement first part
This commit is contained in:
parent
20fa5174b0
commit
c692cd7113
1 changed files with 11 additions and 3 deletions
12
syntax.php
12
syntax.php
|
@ -23,8 +23,16 @@ class syntax_plugin_nextday extends DokuWiki_Syntax_Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($match, $state, $pos, &$handler) {
|
function handle($match, $state, $pos, &$handler) {
|
||||||
$day = strtotime('next friday', strtotime('yesterday'));
|
$match = substr($match,10,-2);
|
||||||
return strftime('%d %B %Y', $day);
|
$day = NULL;
|
||||||
|
if (strlen($match) == 3 && in_array($match, array('mon','tue','wed','thu','fri','sat','sun'))) {
|
||||||
|
$day = strtotime('next ' . $match, strtotime('yesterday'));
|
||||||
|
}
|
||||||
|
if (strlen($match) == 4 && in_array(substr($match,0,3), array('mon','tue','wed','thu','fri','sat','sun'))) {
|
||||||
|
$idx = (int)$match[3];
|
||||||
|
// TODO: find this day :)
|
||||||
|
}
|
||||||
|
return $day ? strftime('%d %B %Y', $day) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function render($mode, &$renderer, $data) {
|
function render($mode, &$renderer, $data) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue