mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Implemented "Date/Time format <attribute> = ..."
This commit is contained in:
parent
c721ebe7ed
commit
55eff7ec63
@ -599,6 +599,10 @@ Admin user = bill
|
|||||||
%H:%M</b> yields in a display of <b>Thursday, November 15, 2001,
|
%H:%M</b> yields in a display of <b>Thursday, November 15, 2001,
|
||||||
12:35</b> for example.
|
12:35</b> for example.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<b><code>Time format <attribute> = <string></code></b><br>
|
||||||
|
Same, but just for an individual attribute.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Date format = <string></code></b><br>
|
<b><code>Date format = <string></code></b><br>
|
||||||
This option determines how the date is displayed from attributes which
|
This option determines how the date is displayed from attributes which
|
||||||
@ -607,6 +611,10 @@ Admin user = bill
|
|||||||
%Y</b> yields in a display of <b>Thursday, November 15, 2001</b> for
|
%Y</b> yields in a display of <b>Thursday, November 15, 2001</b> for
|
||||||
example.
|
example.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<b><code>Date format <attribute> = <string></code></b><br>
|
||||||
|
Same, but just for an individual attribute.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Welcome Page = <file></code></b><br>
|
<b><code>Welcome Page = <file></code></b><br>
|
||||||
By default, the list with the last twenty entries of a logbook is
|
By default, the list with the last twenty entries of a logbook is
|
||||||
|
|||||||
24
src/elogd.c
24
src/elogd.c
@ -8711,7 +8711,10 @@ int build_subst_list(LOGBOOK * lbs, char list[][NAME_LENGTH], char value[][NAME_
|
|||||||
t = (time_t) atoi(attrib[i]);
|
t = (time_t) atoi(attrib[i]);
|
||||||
ts = localtime(&t);
|
ts = localtime(&t);
|
||||||
assert(ts);
|
assert(ts);
|
||||||
if (!getcfg(lbs->name, "Date format", format, sizeof(format)))
|
|
||||||
|
sprintf(str, "Date format %s", attr_list[i]);
|
||||||
|
if (!getcfg(lbs->name, str, format, sizeof(format)))
|
||||||
|
if (!getcfg(lbs->name, "Date format", format, sizeof(format)))
|
||||||
strcpy(format, DEFAULT_DATE_FORMAT);
|
strcpy(format, DEFAULT_DATE_FORMAT);
|
||||||
|
|
||||||
my_strftime(value[i], NAME_LENGTH, format, ts);
|
my_strftime(value[i], NAME_LENGTH, format, ts);
|
||||||
@ -8721,8 +8724,11 @@ int build_subst_list(LOGBOOK * lbs, char list[][NAME_LENGTH], char value[][NAME_
|
|||||||
t = (time_t) atoi(attrib[i]);
|
t = (time_t) atoi(attrib[i]);
|
||||||
ts = localtime(&t);
|
ts = localtime(&t);
|
||||||
assert(ts);
|
assert(ts);
|
||||||
if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
|
|
||||||
strcpy(format, DEFAULT_TIME_FORMAT);
|
sprintf(str, "Time format %s", attr_list[i]);
|
||||||
|
if (!getcfg(lbs->name, str, format, sizeof(format)))
|
||||||
|
if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
|
||||||
|
strcpy(format, DEFAULT_TIME_FORMAT);
|
||||||
|
|
||||||
my_strftime(value[i], NAME_LENGTH, format, ts);
|
my_strftime(value[i], NAME_LENGTH, format, ts);
|
||||||
|
|
||||||
@ -24821,8 +24827,10 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
rsprintf("</td>\n");
|
rsprintf("</td>\n");
|
||||||
} else if (attr_flags[i] & AF_DATE) {
|
} else if (attr_flags[i] & AF_DATE) {
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Date format", format, sizeof(format)))
|
sprintf(str, "Date format %s", attr_list[i]);
|
||||||
strcpy(format, DEFAULT_DATE_FORMAT);
|
if (!getcfg(lbs->name, str, format, sizeof(format)))
|
||||||
|
if (!getcfg(lbs->name, "Date format", format, sizeof(format)))
|
||||||
|
strcpy(format, DEFAULT_DATE_FORMAT);
|
||||||
|
|
||||||
ltime = atoi(attrib[i]);
|
ltime = atoi(attrib[i]);
|
||||||
pts = localtime(<ime);
|
pts = localtime(<ime);
|
||||||
@ -24836,8 +24844,10 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
|
|
||||||
} else if (attr_flags[i] & AF_DATETIME) {
|
} else if (attr_flags[i] & AF_DATETIME) {
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
|
sprintf(str, "Time format %s", attr_list[i]);
|
||||||
strcpy(format, DEFAULT_TIME_FORMAT);
|
if (!getcfg(lbs->name, str, format, sizeof(format)))
|
||||||
|
if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
|
||||||
|
strcpy(format, DEFAULT_TIME_FORMAT);
|
||||||
|
|
||||||
ltime = atoi(attrib[i]);
|
ltime = atoi(attrib[i]);
|
||||||
pts = localtime(<ime);
|
pts = localtime(<ime);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user