Fossil

Check-in [e0762527]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a -local option to the "date" TH1 command. This allows a custom ticket-edit script to use localtime instead of UTC for the date stamp for when a comment is added. Also modify the default ticket-edit script to show UTC after the date stamp, to avoid ambiguity. Ticket [5c1490e26b8b2f8].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e07625279cd9ee70b057deb155535373548dd94d
User & Date: drh 2010-12-30 14:41:53
Context
2010-12-30
16:46
Add a new #include to report.c that is needed by DMC/PellesC compilers. check-in: f5acf22b user: drh tags: trunk
14:41
Add a -local option to the "date" TH1 command. This allows a custom ticket-edit script to use localtime instead of UTC for the date stamp for when a comment is added. Also modify the default ticket-edit script to show UTC after the date stamp, to avoid ambiguity. Ticket [5c1490e26b8b2f8]. check-in: e0762527 user: drh tags: trunk
14:03
Add documentation on how the build process works. check-in: c429b524 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/th_main.c.

166
167
168
169
170
171
172
173


174
175
176
177
178
179
180
181




182

183
184
185
186
187
188
189
  free(zOut);
  return TH_OK;
}

/*
** TH command:      date
**
** Return a string which is the current time and date.


*/
static int dateCmd(
  Th_Interp *interp, 
  void *p, 
  int argc, 
  const char **argv, 
  int *argl
){




  char *zOut = db_text("??", "SELECT datetime('now')");

  Th_SetResult(interp, zOut, -1);
  free(zOut);
  return TH_OK;
}

/*
** TH command:     hascap STRING







|
>
>








>
>
>
>
|
>







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
  free(zOut);
  return TH_OK;
}

/*
** TH command:      date
**
** Return a string which is the current time and date.  If the
** -local option is used, the date appears using localtime instead
** of UTC.
*/
static int dateCmd(
  Th_Interp *interp, 
  void *p, 
  int argc, 
  const char **argv, 
  int *argl
){
  char *zOut;
  if( argc>=2 && argl[1]==6 && memcmp(argv[1],"-local",6)==0 ){
    zOut = db_text("??", "SELECT datetime('now','localtime')");
  }else{
    zOut = db_text("??", "SELECT datetime('now')");
  }
  Th_SetResult(interp, zOut, -1);
  free(zOut);
  return TH_OK;
}

/*
** TH command:     hascap STRING

Changes to src/tktsetup.c.

432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
@   if {[info exists submit]} {
@     if {[info exists cmappnd]} {
@       if {[string length $cmappnd]>0} {
@         set ctxt "\n\n<hr /><i>[htmlize $login]"
@         if {$username ne $login} {
@           set ctxt "$ctxt claiming to be [htmlize $username]"
@         }
@         set ctxt "$ctxt added on [date]:</i><br />\n$cmappnd"
@         append_field comment $ctxt
@       }
@     }
@     submit_ticket
@   }
@ </th1>
@ <table cellpadding="5">







|







432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
@   if {[info exists submit]} {
@     if {[info exists cmappnd]} {
@       if {[string length $cmappnd]>0} {
@         set ctxt "\n\n<hr /><i>[htmlize $login]"
@         if {$username ne $login} {
@           set ctxt "$ctxt claiming to be [htmlize $username]"
@         }
@         set ctxt "$ctxt added on [date] UTC:</i><br />\n$cmappnd"
@         append_field comment $ctxt
@       }
@     }
@     submit_ticket
@   }
@ </th1>
@ <table cellpadding="5">