- Timestamp:
- Sep 3, 2009, 11:27:00 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- d694c55
- Parents:
- 4df918b
- git-author:
- Alex Dehnert <adehnert@mit.edu> (09/03/09 17:02:49)
- git-committer:
- Alex Dehnert <adehnert@mit.edu> (09/03/09 23:27:00)
- Location:
- perl/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
r4df918b r0b2afba 327 327 328 328 sub register_builtin_commands { 329 # Filter modification 329 330 BarnOwl::new_command("filterappend", 330 331 sub { filter_append_helper('appending', '', @_); }, … … 346 347 summary => "append 'or <text>' to filter", 347 348 usage => "filteror <filter> <text>", 349 }); 350 351 # Date formatting 352 BarnOwl::new_command("showdate", 353 sub { BarnOwl::time_format('showdate', '%Y-%m-%d %H:%M'); }, 354 { 355 summary => "Show date in timestamps for supporting styles.", 356 usage => "showdate", 357 }); 358 359 BarnOwl::new_command("hidedate", 360 sub { BarnOwl::time_format('hidedate', '%H:%M'); }, 361 { 362 summary => "Don't show date in timestamps for supporting styles.", 363 usage => "hidedate", 364 }); 365 366 BarnOwl::new_command("timeformat", 367 \&BarnOwl::time_format, 368 { 369 summary => "Set the format for timestamps and re-display messages", 370 usage => "timeformat <format>", 348 371 }); 349 372 … … 379 402 summary => 'Show modifications to filters by filterappend and friends.'}); 380 403 404 =head3 time_format FORMAT 405 406 Set the format for displaying times (variable timeformat) and redisplay 407 messages. 408 409 =cut 410 411 my $timeformat; 412 413 sub time_format 414 { 415 my $function = shift; 416 my $format = shift; 417 if(!$format) 418 { 419 return $timeformat; 420 } 421 if(shift) 422 { 423 return "Wrong number of arguments for command"; 424 } 425 $timeformat = $format; 426 redisplay(); 427 } 428 381 429 1; -
perl/lib/BarnOwl/Style/Default.pm
r5550eb0 r0b2afba 42 42 my $self = shift; 43 43 my $m = shift; 44 return strftime('%H:%M', localtime($m->unix_time)); 44 my $dateformat = BarnOwl::time_format('get_time_format'); 45 return strftime($dateformat, localtime($m->unix_time)); 45 46 } 46 47
Note: See TracChangeset
for help on using the changeset viewer.