mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 08:53:37 +01:00
Etemplate - add 'format' option to timestamper to specify the time format
This commit is contained in:
parent
07de0df0ea
commit
d055f04f96
@ -30,6 +30,12 @@ var et2_timestamper = (function(){ "use strict"; return et2_button.extend([],
|
|||||||
default: et2_no_init,
|
default: et2_no_init,
|
||||||
description: "Which field to place the timestamp in"
|
description: "Which field to place the timestamp in"
|
||||||
},
|
},
|
||||||
|
format: {
|
||||||
|
name: "Time format",
|
||||||
|
type: "string",
|
||||||
|
default: et2_no_init,
|
||||||
|
description: "Format for the timestamp. User is always after."
|
||||||
|
},
|
||||||
image: {
|
image: {
|
||||||
default: "timestamp"
|
default: "timestamp"
|
||||||
},
|
},
|
||||||
@ -65,7 +71,11 @@ var et2_timestamper = (function(){ "use strict"; return et2_button.extend([],
|
|||||||
_insert_text: function() {
|
_insert_text: function() {
|
||||||
var text = "";
|
var text = "";
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
text += date(egw.preference('dateformat') + ' ' + (egw.preference("timeformat") === "12" ? "h:ia" : "H:i")+' ',now);
|
var format = (this.options.format ?
|
||||||
|
this.options.format :
|
||||||
|
egw.preference('dateformat') + ' ' + (egw.preference("timeformat") === "12" ? "h:ia" : "H:i"))+' ';
|
||||||
|
|
||||||
|
text += date(format, now);
|
||||||
|
|
||||||
// Get properly formatted user name
|
// Get properly formatted user name
|
||||||
var user = parseInt(egw.user('account_id'));
|
var user = parseInt(egw.user('account_id'));
|
||||||
|
Loading…
Reference in New Issue
Block a user