Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 3e799859f4
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (40 sloc) 1.23 KB
from google.appengine.ext import webapp
register = webapp.template.create_template_register()
def strip_spaces(string):
return string.replace(" ", "")
def american_date(element):
return element.strftime('%m/%d/%Y')
def check_filter(the_list, item):
if item in the_list:
cb = "checked='checked'"
cb = ""
return cb
def select_hour(event, item):
return select_time(event,item,'hour')
def select_minute(event, item):
return select_time(event,item,'minute')
def select_ampm(event, item):
return select_time(event,item,'ampm')
# event = event timestamp
# item = UI element value (e.g., the specific hour or minute to compare)
# element = hour, minute, ampm
def select_time(event,item,element):
st = ""
if element == 'hour':
eh = event.hour if event.hour < 12 else event.hour - 12
if eh == item:
st = "selected='selected'"
if element == 'minute' and event.minute == item:
st = "selected='selected'"
if element == 'ampm':
half = "am" if event.hour < 12 else "pm"
if half == item:
st = "selected='selected'"
return st
Jump to Line
Something went wrong with that request. Please try again.