Fossil SCM
Add the datefmt query parameter that will override the default timeline date format.
Commit
bc3db82dff93a9afbf3fb891e8268ad75350d1fe
Parent
e5176d9473a7c5d…
1 file changed
+8
-2
+8
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -213,17 +213,20 @@ | ||
| 213 | 213 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 214 | 214 | static Stmt qbranch; |
| 215 | 215 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 216 | 216 | int vid = 0; /* Current checkout version */ |
| 217 | 217 | int dateFormat = 0; /* 0: HH:MM (default) */ |
| 218 | + char *zDateFmt; | |
| 218 | 219 | |
| 219 | 220 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 220 | 221 | vid = db_lget_int("checkout", 0); |
| 221 | 222 | } |
| 222 | 223 | zPrevDate[0] = 0; |
| 223 | 224 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 224 | 225 | dateFormat = db_get_int("timeline-date-format", 0); |
| 226 | + zDateFmt = P("datefmt"); | |
| 227 | + if( zDateFmt ) dateFormat = atoi(zDateFmt); | |
| 225 | 228 | if( tmFlags & TIMELINE_GRAPH ){ |
| 226 | 229 | pGraph = graph_init(); |
| 227 | 230 | /* style is not moved to css, because this is |
| 228 | 231 | ** a technical div for the timeline graph |
| 229 | 232 | */ |
| @@ -252,11 +255,13 @@ | ||
| 252 | 255 | const char *zBr = 0; /* Branch */ |
| 253 | 256 | int commentColumn = 3; /* Column containing comment text */ |
| 254 | 257 | int modPending; /* Pending moderation */ |
| 255 | 258 | char zTime[20]; |
| 256 | 259 | |
| 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 | + } | |
| 258 | 263 | modPending = moderation_pending(rid); |
| 259 | 264 | if( tagid ){ |
| 260 | 265 | if( modPending ) tagid = -tagid; |
| 261 | 266 | if( tagid==prevTagid ){ |
| 262 | 267 | if( tmFlags & TIMELINE_BRIEF ){ |
| @@ -1018,10 +1023,11 @@ | ||
| 1018 | 1023 | ** uf=FUUID Show only checkins that use given file version |
| 1019 | 1024 | ** brbg Background color from branch name |
| 1020 | 1025 | ** ubg Background color from user |
| 1021 | 1026 | ** namechng Show only checkins that filename changes |
| 1022 | 1027 | ** ym=YYYY-MM Shown only events for the given year/month. |
| 1028 | +** datefmt=N Override the date format | |
| 1023 | 1029 | ** |
| 1024 | 1030 | ** p= and d= can appear individually or together. If either p= or d= |
| 1025 | 1031 | ** appear, then u=, y=, a=, and b= are ignored. |
| 1026 | 1032 | ** |
| 1027 | 1033 | ** If a= and b= appear, only a= is used. If neither appear, the most |
| @@ -1045,11 +1051,11 @@ | ||
| 1045 | 1051 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1046 | 1052 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1047 | 1053 | const char *zSearch = P("s"); /* Search string */ |
| 1048 | 1054 | const char *zUses = P("uf"); /* Only show checkins hold this file */ |
| 1049 | 1055 | 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)*/ | |
| 1051 | 1057 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1052 | 1058 | int renameOnly = P("namechng")!=0; /* Show only checkins that rename files */ |
| 1053 | 1059 | int tagid; /* Tag ID */ |
| 1054 | 1060 | int tmFlags; /* Timeline flags */ |
| 1055 | 1061 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1056 | 1062 |
| --- 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 |