Fossil SCM
Added "YYMMDD HH:MM" option to timeline timestamp config, per ML request.
Commit
feef2d153c08d1212cdfb63ff2e372d8a6f88338
Parent
403d93728730587…
2 files changed
+5
-4
+15
-1
+5
-4
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1154,11 +1154,12 @@ | ||
| 1154 | 1154 | double tmDiff; |
| 1155 | 1155 | char zTmDiff[20]; |
| 1156 | 1156 | static const char *azTimeFormats[] = { |
| 1157 | 1157 | "0", "HH:MM", |
| 1158 | 1158 | "1", "HH:MM:SS", |
| 1159 | - "2", "YYYY-MM-DD HH:MM" | |
| 1159 | + "2", "YYYY-MM-DD HH:MM", | |
| 1160 | + "3", "YYMMDD HH:MM" | |
| 1160 | 1161 | }; |
| 1161 | 1162 | login_check_credentials(); |
| 1162 | 1163 | if( !g.perm.Setup ){ |
| 1163 | 1164 | login_needed(); |
| 1164 | 1165 | } |
| @@ -1201,15 +1202,15 @@ | ||
| 1201 | 1202 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1202 | 1203 | } |
| 1203 | 1204 | |
| 1204 | 1205 | @ <hr /> |
| 1205 | 1206 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", "tdf", "0", |
| 1206 | - 3, azTimeFormats); | |
| 1207 | + 4, azTimeFormats); | |
| 1207 | 1208 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1208 | 1209 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1209 | - @ With the "YYYY-MM-DD 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 HH:MM" and "YYMMDD ..." formats, the complete date | |
| 1211 | + @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> | |
| 1211 | 1212 | |
| 1212 | 1213 | @ <hr /> |
| 1213 | 1214 | onoff_attribute("Show version differences by default", |
| 1214 | 1215 | "show-version-diffs", "vdiff", 0, 0); |
| 1215 | 1216 | @ <p>On the version-information pages linked from the timeline can either |
| 1216 | 1217 |
| --- 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 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 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 @@ | ||
| 246 | 246 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 247 | 247 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 248 | 248 | static Stmt qbranch; |
| 249 | 249 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 250 | 250 | 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 */ | |
| 252 | 254 | |
| 253 | 255 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 254 | 256 | vid = db_lget_int("checkout", 0); |
| 255 | 257 | } |
| 256 | 258 | zPrevDate[0] = 0; |
| @@ -325,11 +327,23 @@ | ||
| 325 | 327 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 326 | 328 | @ </td><td></td><td></td></tr> |
| 327 | 329 | } |
| 328 | 330 | memcpy(zTime, &zDate[11], 5+dateFormat*3); |
| 329 | 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; | |
| 330 | 343 | }else{ |
| 344 | + /* YYYY-MM-DD HH:MM */ | |
| 331 | 345 | sqlite3_snprintf(sizeof(zTime), zTime, "%.16s", zDate); |
| 332 | 346 | } |
| 333 | 347 | if( rid == vid ){ |
| 334 | 348 | @ <tr class="timelineCurrent"> |
| 335 | 349 | }else { |
| 336 | 350 |
| --- 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 |