Make start dates work for all modules
* error modules now hidden via access control * get_module() returns None if user doesn't have access
This commit is contained in:
@@ -3,9 +3,17 @@ Helper functions for handling time in the format we like.
|
||||
"""
|
||||
import time
|
||||
|
||||
TIME_FORMAT = "%Y-%m-%dT%H:%M"
|
||||
|
||||
def parse_time(time_str):
|
||||
"""
|
||||
Takes a time string in our format ("%Y-%m-%dT%H:%M"), and returns
|
||||
Takes a time string in TIME_FORMAT, returns
|
||||
it as a time_struct. Raises ValueError if the string is not in the right format.
|
||||
"""
|
||||
return time.strptime(time_str, "%Y-%m-%dT%H:%M")
|
||||
return time.strptime(time_str, TIME_FORMAT)
|
||||
|
||||
def stringify_time(time_struct):
|
||||
"""
|
||||
Convert a time struct to a string
|
||||
"""
|
||||
return time.strftime(TIME_FORMAT, time_struct)
|
||||
|
||||
Reference in New Issue
Block a user