mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
+ In task edit: show dates when the task was created and completed
This commit is contained in:
parent
b4ea7fc924
commit
6967812626
5 changed files with 15 additions and 3 deletions
|
|
@ -288,6 +288,9 @@ function editTask(id)
|
|||
for(var i=0; i<sel.length; i++) {
|
||||
if(sel.options[i].value == item.prio) sel.options[i].selected = true;
|
||||
}
|
||||
$('#taskedit-date .date-created>span').text(item.date);
|
||||
if(item.compl) $('#taskedit-date .date-completed').show().find('span').text(item.dateCompleted);
|
||||
else $('#taskedit-date .date-completed').hide();
|
||||
showEditForm();
|
||||
return false;
|
||||
}
|
||||
|
|
@ -299,11 +302,11 @@ function showEditForm(isAdd)
|
|||
if(document.selection && document.selection.empty) document.selection.empty();
|
||||
else if(window.getSelection) window.getSelection().removeAllRanges();
|
||||
if(isAdd) {
|
||||
showhide($('#page_taskedit>h3.mtt-inadd'), $('#page_taskedit>h3.mtt-inedit'));
|
||||
$('#page_taskedit').removeClass('mtt-inedit').addClass('mtt-inadd');
|
||||
document.edittask.isadd.value = 1;
|
||||
}
|
||||
else {
|
||||
showhide( $('#page_taskedit>h3.mtt-inedit'), $('#page_taskedit>h3.mtt-inadd'));
|
||||
$('#page_taskedit').removeClass('mtt-inadd').addClass('mtt-inedit');
|
||||
document.edittask.isadd.value = 0;
|
||||
}
|
||||
var w = $('#page_taskedit');
|
||||
|
|
|
|||
|
|
@ -439,6 +439,7 @@ function prepareTaskRow($r, $tz)
|
|||
'title' => htmlarray($r['title']),
|
||||
'date' => htmlarray($dCreated),
|
||||
'dateInline' => htmlarray(sprintf($lang->get('taskdate_inline'), $dCreated)),
|
||||
'dateCompleted' => htmlarray(timestampToDatetime($r['d_completed'], $tz)),
|
||||
'compl' => (int)$r['compl'],
|
||||
'prio' => $r['prio'],
|
||||
'note' => nl2br(htmlarray($r['note'])),
|
||||
|
|
|
|||
|
|
@ -141,6 +141,11 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
|
|||
<div id="page_taskedit" style="display:none">
|
||||
|
||||
<h3 class="mtt-inadd"><?php _e('add_task');?></h3>
|
||||
|
||||
<div id="taskedit-date" class="mtt-inedit">
|
||||
<div class="date-created">Created: <span></span></div>
|
||||
<div class="date-completed">Completed: <span></span></div>
|
||||
</div>
|
||||
<h3 class="mtt-inedit"><?php _e('edit_task');?></h3>
|
||||
|
||||
<form onSubmit="return saveTask(this)" name="edittask">
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ function timestampToDatetime($timestamp, $tz)
|
|||
{
|
||||
global $lang;
|
||||
$format = Config::get('dateformat') .' '. (Config::get('clock') == 12 ? 'g:i A' : 'H:i');
|
||||
return formatTime($timestamp, $format, $tz);
|
||||
return formatTime($format, $timestamp, $tz);
|
||||
}
|
||||
|
||||
function formatTime($format, $timestamp=0, $tz=null)
|
||||
|
|
|
|||
|
|
@ -118,6 +118,9 @@ div.task-note-area textarea { color:#999999; width:100%; display:block; height:6
|
|||
.ui-icon-gripsmall-diagonal-se { background-image:url(images/resizegrip.gif); }
|
||||
#alltags .tag { font-weight:bold; color:#333333; }
|
||||
#alltags .tag:hover { background-color:#999988; color:white; }
|
||||
#page_taskedit.mtt-inadd .mtt-inedit { display:none; }
|
||||
#page_taskedit.mtt-inedit .mtt-inadd { display:none; }
|
||||
#taskedit-date { font-size:8pt; font-weight:normal; text-align:right; float:right; color:#777; }
|
||||
|
||||
/* autocomplete */
|
||||
.ac_results { padding: 0px; border: 1px solid #cccccc; background-color: #f0f0f0; overflow: hidden; z-index: 99999; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue