Fossil SCM

Add the datefmt query parameter that will override the default timeline date format.

drh 2014-11-09 00:36 trunk
Commit bc3db82dff93a9afbf3fb891e8268ad75350d1fe
1 file changed +8 -2
+8 -2
--- src/timeline.c
+++ src/timeline.c
@@ -213,17 +213,20 @@
213213
Stmt fchngQuery; /* Query for file changes on check-ins */
214214
static Stmt qbranch;
215215
int pendingEndTr = 0; /* True if a </td></tr> is needed */
216216
int vid = 0; /* Current checkout version */
217217
int dateFormat = 0; /* 0: HH:MM (default) */
218
+ char *zDateFmt;
218219
219220
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
220221
vid = db_lget_int("checkout", 0);
221222
}
222223
zPrevDate[0] = 0;
223224
mxWikiLen = db_get_int("timeline-max-comment", 0);
224225
dateFormat = db_get_int("timeline-date-format", 0);
226
+ zDateFmt = P("datefmt");
227
+ if( zDateFmt ) dateFormat = atoi(zDateFmt);
225228
if( tmFlags & TIMELINE_GRAPH ){
226229
pGraph = graph_init();
227230
/* style is not moved to css, because this is
228231
** a technical div for the timeline graph
229232
*/
@@ -252,11 +255,13 @@
252255
const char *zBr = 0; /* Branch */
253256
int commentColumn = 3; /* Column containing comment text */
254257
int modPending; /* Pending moderation */
255258
char zTime[20];
256259
257
- if( zDate==0 ) zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
260
+ if( zDate==0 ){
261
+ zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
262
+ }
258263
modPending = moderation_pending(rid);
259264
if( tagid ){
260265
if( modPending ) tagid = -tagid;
261266
if( tagid==prevTagid ){
262267
if( tmFlags & TIMELINE_BRIEF ){
@@ -1018,10 +1023,11 @@
10181023
** uf=FUUID Show only checkins that use given file version
10191024
** brbg Background color from branch name
10201025
** ubg Background color from user
10211026
** namechng Show only checkins that filename changes
10221027
** ym=YYYY-MM Shown only events for the given year/month.
1028
+** datefmt=N Override the date format
10231029
**
10241030
** p= and d= can appear individually or together. If either p= or d=
10251031
** appear, then u=, y=, a=, and b= are ignored.
10261032
**
10271033
** If a= and b= appear, only a= is used. If neither appear, the most
@@ -1045,11 +1051,11 @@
10451051
const char *zTagName = P("t"); /* Show events with this tag */
10461052
const char *zBrName = P("r"); /* Show events related to this tag */
10471053
const char *zSearch = P("s"); /* Search string */
10481054
const char *zUses = P("uf"); /* Only show checkins hold this file */
10491055
const char *zYearMonth = P("ym"); /* Show checkins for the given YYYY-MM */
1050
- const char *zYearWeek = P("yw"); /* Show checkins for the given YYYY-WW (weak-of-year) */
1056
+ const char *zYearWeek = P("yw"); /* Show checkins for the given YYYY-WW (week-of-year)*/
10511057
int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
10521058
int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */
10531059
int tagid; /* Tag ID */
10541060
int tmFlags; /* Timeline flags */
10551061
const char *zThisTag = 0; /* Suppress links to this tag */
10561062
--- src/timeline.c
+++ src/timeline.c
@@ -213,17 +213,20 @@
213 Stmt fchngQuery; /* Query for file changes on check-ins */
214 static Stmt qbranch;
215 int pendingEndTr = 0; /* True if a </td></tr> is needed */
216 int vid = 0; /* Current checkout version */
217 int dateFormat = 0; /* 0: HH:MM (default) */
 
218
219 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
220 vid = db_lget_int("checkout", 0);
221 }
222 zPrevDate[0] = 0;
223 mxWikiLen = db_get_int("timeline-max-comment", 0);
224 dateFormat = db_get_int("timeline-date-format", 0);
 
 
225 if( tmFlags & TIMELINE_GRAPH ){
226 pGraph = graph_init();
227 /* style is not moved to css, because this is
228 ** a technical div for the timeline graph
229 */
@@ -252,11 +255,13 @@
252 const char *zBr = 0; /* Branch */
253 int commentColumn = 3; /* Column containing comment text */
254 int modPending; /* Pending moderation */
255 char zTime[20];
256
257 if( zDate==0 ) zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
 
 
258 modPending = moderation_pending(rid);
259 if( tagid ){
260 if( modPending ) tagid = -tagid;
261 if( tagid==prevTagid ){
262 if( tmFlags & TIMELINE_BRIEF ){
@@ -1018,10 +1023,11 @@
1018 ** uf=FUUID Show only checkins that use given file version
1019 ** brbg Background color from branch name
1020 ** ubg Background color from user
1021 ** namechng Show only checkins that filename changes
1022 ** ym=YYYY-MM Shown only events for the given year/month.
 
1023 **
1024 ** p= and d= can appear individually or together. If either p= or d=
1025 ** appear, then u=, y=, a=, and b= are ignored.
1026 **
1027 ** If a= and b= appear, only a= is used. If neither appear, the most
@@ -1045,11 +1051,11 @@
1045 const char *zTagName = P("t"); /* Show events with this tag */
1046 const char *zBrName = P("r"); /* Show events related to this tag */
1047 const char *zSearch = P("s"); /* Search string */
1048 const char *zUses = P("uf"); /* Only show checkins hold this file */
1049 const char *zYearMonth = P("ym"); /* Show checkins for the given YYYY-MM */
1050 const char *zYearWeek = P("yw"); /* Show checkins for the given YYYY-WW (weak-of-year) */
1051 int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
1052 int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */
1053 int tagid; /* Tag ID */
1054 int tmFlags; /* Timeline flags */
1055 const char *zThisTag = 0; /* Suppress links to this tag */
1056
--- src/timeline.c
+++ src/timeline.c
@@ -213,17 +213,20 @@
213 Stmt fchngQuery; /* Query for file changes on check-ins */
214 static Stmt qbranch;
215 int pendingEndTr = 0; /* True if a </td></tr> is needed */
216 int vid = 0; /* Current checkout version */
217 int dateFormat = 0; /* 0: HH:MM (default) */
218 char *zDateFmt;
219
220 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
221 vid = db_lget_int("checkout", 0);
222 }
223 zPrevDate[0] = 0;
224 mxWikiLen = db_get_int("timeline-max-comment", 0);
225 dateFormat = db_get_int("timeline-date-format", 0);
226 zDateFmt = P("datefmt");
227 if( zDateFmt ) dateFormat = atoi(zDateFmt);
228 if( tmFlags & TIMELINE_GRAPH ){
229 pGraph = graph_init();
230 /* style is not moved to css, because this is
231 ** a technical div for the timeline graph
232 */
@@ -252,11 +255,13 @@
255 const char *zBr = 0; /* Branch */
256 int commentColumn = 3; /* Column containing comment text */
257 int modPending; /* Pending moderation */
258 char zTime[20];
259
260 if( zDate==0 ){
261 zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
262 }
263 modPending = moderation_pending(rid);
264 if( tagid ){
265 if( modPending ) tagid = -tagid;
266 if( tagid==prevTagid ){
267 if( tmFlags & TIMELINE_BRIEF ){
@@ -1018,10 +1023,11 @@
1023 ** uf=FUUID Show only checkins that use given file version
1024 ** brbg Background color from branch name
1025 ** ubg Background color from user
1026 ** namechng Show only checkins that filename changes
1027 ** ym=YYYY-MM Shown only events for the given year/month.
1028 ** datefmt=N Override the date format
1029 **
1030 ** p= and d= can appear individually or together. If either p= or d=
1031 ** appear, then u=, y=, a=, and b= are ignored.
1032 **
1033 ** If a= and b= appear, only a= is used. If neither appear, the most
@@ -1045,11 +1051,11 @@
1051 const char *zTagName = P("t"); /* Show events with this tag */
1052 const char *zBrName = P("r"); /* Show events related to this tag */
1053 const char *zSearch = P("s"); /* Search string */
1054 const char *zUses = P("uf"); /* Only show checkins hold this file */
1055 const char *zYearMonth = P("ym"); /* Show checkins for the given YYYY-MM */
1056 const char *zYearWeek = P("yw"); /* Show checkins for the given YYYY-WW (week-of-year)*/
1057 int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
1058 int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */
1059 int tagid; /* Tag ID */
1060 int tmFlags; /* Timeline flags */
1061 const char *zThisTag = 0; /* Suppress links to this tag */
1062

Keyboard Shortcuts

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