Changeset 46 for lang

Show
Ignore:
Timestamp:
05/11/08 09:52:17 (16 years ago)
Author:
naoya_t
Message:

irc-logger/htdocs/logview.cgi: make today the default date

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/gauche/irc-logger/trunk/htdocs/logview.cgi

    r43 r46  
    55(require "../setting") 
    66(require "../lib/rawlog") 
     7 
     8(use srfi-19) 
    79 
    810(define (it s) #`"<i>,|s|</i>") 
     
    4042(define query-string (sys-getenv "QUERY_STRING")) 
    4143 
    42 (unless (and query-string (rxmatch #/^20[0-9][0-9]-[01][0-9]-[0-3][0-9]$/ query-string)) 
    43   (display "Content-type: text/html") (newline) (newline) 
    44   (error "invalid query string")) 
    45  
    46 (define date-str query-string) 
     44(define date-str (if (and query-string (rxmatch #/^20[0-9][0-9]-[01][0-9]-[0-3][0-9]$/ query-string)) 
     45                     query-string 
     46                     (date->string (current-date) "~Y-~m-~d"))) 
    4747 
    4848(display "Content-type: text/html\r\n\r\n")