24 lines
629 B
JavaScript
Executable file
24 lines
629 B
JavaScript
Executable file
/* Adds Date/Timestamp to a comments field when it's selected for modifiying. */
|
|
|
|
Event.observe(window, 'load', function() {
|
|
$('comments').disable();
|
|
|
|
});
|
|
|
|
function datetime(userinitials) {
|
|
$('comments').enable();
|
|
$('datebutton').disable();
|
|
var currentTime = new Date();
|
|
month = currentTime.getMonth() + 1;
|
|
day = currentTime.getDate();
|
|
year = currentTime.getFullYear();
|
|
hour = currentTime.getHours();
|
|
minute = currentTime.getMinutes();
|
|
if(minute < 10) {
|
|
minute = '0'+minute;
|
|
}
|
|
|
|
|
|
$('comments').value = '[' + day + '-' + month + '-' + year + ' @' + hour + ':' + minute +' '+ userinitials +']' + '\n' + $('comments').value;
|
|
}
|