Fossil SCM

Added "YYMMDD HH:MM" option to timeline timestamp config, per ML request.

stephan 2013-10-18 16:05 trunk
Commit feef2d153c08d1212cdfb63ff2e372d8a6f88338
2 files changed +5 -4 +15 -1
+5 -4
--- src/setup.c
+++ src/setup.c
@@ -1154,11 +1154,12 @@
11541154
double tmDiff;
11551155
char zTmDiff[20];
11561156
static const char *azTimeFormats[] = {
11571157
"0", "HH:MM",
11581158
"1", "HH:MM:SS",
1159
- "2", "YYYY-MM-DD HH:MM"
1159
+ "2", "YYYY-MM-DD HH:MM",
1160
+ "3", "YYMMDD HH:MM"
11601161
};
11611162
login_check_credentials();
11621163
if( !g.perm.Setup ){
11631164
login_needed();
11641165
}
@@ -1201,15 +1202,15 @@
12011202
@ %s(zTmDiff) hours ahead of UTC.</p>
12021203
}
12031204
12041205
@ <hr />
12051206
multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", "tdf", "0",
1206
- 3, azTimeFormats);
1207
+ 4, azTimeFormats);
12071208
@ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown
12081209
@ in a separate box (using CSS class "timelineDate") whenever the date changes.
1209
- @ With the "YYYY-MM-DD&nbsp;HH:MM" format, the complete date and time is shown on
1210
- @ every timeline entry (using the CSS class "timelineTime").</p>
1210
+ @ With the "YYYY-MM-DD&nbsp;HH:MM" and "YYMMDD ..." formats, the complete date
1211
+ @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p>
12111212
12121213
@ <hr />
12131214
onoff_attribute("Show version differences by default",
12141215
"show-version-diffs", "vdiff", 0, 0);
12151216
@ <p>On the version-information pages linked from the timeline can either
12161217
--- src/setup.c
+++ src/setup.c
@@ -1154,11 +1154,12 @@
1154 double tmDiff;
1155 char zTmDiff[20];
1156 static const char *azTimeFormats[] = {
1157 "0", "HH:MM",
1158 "1", "HH:MM:SS",
1159 "2", "YYYY-MM-DD HH:MM"
 
1160 };
1161 login_check_credentials();
1162 if( !g.perm.Setup ){
1163 login_needed();
1164 }
@@ -1201,15 +1202,15 @@
1201 @ %s(zTmDiff) hours ahead of UTC.</p>
1202 }
1203
1204 @ <hr />
1205 multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", "tdf", "0",
1206 3, azTimeFormats);
1207 @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown
1208 @ in a separate box (using CSS class "timelineDate") whenever the date changes.
1209 @ With the "YYYY-MM-DD&nbsp;HH:MM" format, the complete date and time is shown on
1210 @ every timeline entry (using the CSS class "timelineTime").</p>
1211
1212 @ <hr />
1213 onoff_attribute("Show version differences by default",
1214 "show-version-diffs", "vdiff", 0, 0);
1215 @ <p>On the version-information pages linked from the timeline can either
1216
--- src/setup.c
+++ src/setup.c
@@ -1154,11 +1154,12 @@
1154 double tmDiff;
1155 char zTmDiff[20];
1156 static const char *azTimeFormats[] = {
1157 "0", "HH:MM",
1158 "1", "HH:MM:SS",
1159 "2", "YYYY-MM-DD HH:MM",
1160 "3", "YYMMDD HH:MM"
1161 };
1162 login_check_credentials();
1163 if( !g.perm.Setup ){
1164 login_needed();
1165 }
@@ -1201,15 +1202,15 @@
1202 @ %s(zTmDiff) hours ahead of UTC.</p>
1203 }
1204
1205 @ <hr />
1206 multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", "tdf", "0",
1207 4, azTimeFormats);
1208 @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown
1209 @ in a separate box (using CSS class "timelineDate") whenever the date changes.
1210 @ With the "YYYY-MM-DD&nbsp;HH:MM" and "YYMMDD ..." formats, the complete date
1211 @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p>
1212
1213 @ <hr />
1214 onoff_attribute("Show version differences by default",
1215 "show-version-diffs", "vdiff", 0, 0);
1216 @ <p>On the version-information pages linked from the timeline can either
1217
+15 -1
--- src/timeline.c
+++ src/timeline.c
@@ -246,11 +246,13 @@
246246
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
247247
Stmt fchngQuery; /* Query for file changes on check-ins */
248248
static Stmt qbranch;
249249
int pendingEndTr = 0; /* True if a </td></tr> is needed */
250250
int vid = 0; /* Current checkout version */
251
- int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS 2: YYYY-MM-DD HH:MM */
251
+ int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS
252
+ 2: YYYY-MM-DD HH:MM
253
+ 3: YYMMDD HH:MM */
252254
253255
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
254256
vid = db_lget_int("checkout", 0);
255257
}
256258
zPrevDate[0] = 0;
@@ -325,11 +327,23 @@
325327
@ <div class="divider timelineDate">%s(zPrevDate)</div>
326328
@ </td><td></td><td></td></tr>
327329
}
328330
memcpy(zTime, &zDate[11], 5+dateFormat*3);
329331
zTime[5+dateFormat*3] = 0;
332
+ }else if(3==dateFormat){
333
+ /* YYMMDD HH:MM */
334
+ int pos = 0;
335
+ zTime[pos++] = zDate[2]; zTime[pos++] = zDate[3]; /* YY */
336
+ zTime[pos++] = zDate[5]; zTime[pos++] = zDate[6]; /* MM */
337
+ zTime[pos++] = zDate[8]; zTime[pos++] = zDate[9]; /* DD */
338
+ zTime[pos++] = ' ';
339
+ zTime[pos++] = zDate[11]; zTime[pos++] = zDate[12]; /* HH */
340
+ zTime[pos++] = ':';
341
+ zTime[pos++] = zDate[14]; zTime[pos++] = zDate[15]; /* MM */
342
+ zTime[pos++] = 0;
330343
}else{
344
+ /* YYYY-MM-DD HH:MM */
331345
sqlite3_snprintf(sizeof(zTime), zTime, "%.16s", zDate);
332346
}
333347
if( rid == vid ){
334348
@ <tr class="timelineCurrent">
335349
}else {
336350
--- src/timeline.c
+++ src/timeline.c
@@ -246,11 +246,13 @@
246 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
247 Stmt fchngQuery; /* Query for file changes on check-ins */
248 static Stmt qbranch;
249 int pendingEndTr = 0; /* True if a </td></tr> is needed */
250 int vid = 0; /* Current checkout version */
251 int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS 2: YYYY-MM-DD HH:MM */
 
 
252
253 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
254 vid = db_lget_int("checkout", 0);
255 }
256 zPrevDate[0] = 0;
@@ -325,11 +327,23 @@
325 @ <div class="divider timelineDate">%s(zPrevDate)</div>
326 @ </td><td></td><td></td></tr>
327 }
328 memcpy(zTime, &zDate[11], 5+dateFormat*3);
329 zTime[5+dateFormat*3] = 0;
 
 
 
 
 
 
 
 
 
 
 
330 }else{
 
331 sqlite3_snprintf(sizeof(zTime), zTime, "%.16s", zDate);
332 }
333 if( rid == vid ){
334 @ <tr class="timelineCurrent">
335 }else {
336
--- src/timeline.c
+++ src/timeline.c
@@ -246,11 +246,13 @@
246 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
247 Stmt fchngQuery; /* Query for file changes on check-ins */
248 static Stmt qbranch;
249 int pendingEndTr = 0; /* True if a </td></tr> is needed */
250 int vid = 0; /* Current checkout version */
251 int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS
252 2: YYYY-MM-DD HH:MM
253 3: YYMMDD HH:MM */
254
255 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
256 vid = db_lget_int("checkout", 0);
257 }
258 zPrevDate[0] = 0;
@@ -325,11 +327,23 @@
327 @ <div class="divider timelineDate">%s(zPrevDate)</div>
328 @ </td><td></td><td></td></tr>
329 }
330 memcpy(zTime, &zDate[11], 5+dateFormat*3);
331 zTime[5+dateFormat*3] = 0;
332 }else if(3==dateFormat){
333 /* YYMMDD HH:MM */
334 int pos = 0;
335 zTime[pos++] = zDate[2]; zTime[pos++] = zDate[3]; /* YY */
336 zTime[pos++] = zDate[5]; zTime[pos++] = zDate[6]; /* MM */
337 zTime[pos++] = zDate[8]; zTime[pos++] = zDate[9]; /* DD */
338 zTime[pos++] = ' ';
339 zTime[pos++] = zDate[11]; zTime[pos++] = zDate[12]; /* HH */
340 zTime[pos++] = ':';
341 zTime[pos++] = zDate[14]; zTime[pos++] = zDate[15]; /* MM */
342 zTime[pos++] = 0;
343 }else{
344 /* YYYY-MM-DD HH:MM */
345 sqlite3_snprintf(sizeof(zTime), zTime, "%.16s", zDate);
346 }
347 if( rid == vid ){
348 @ <tr class="timelineCurrent">
349 }else {
350

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button