def datetime_format_to_js_datetime_format(format):
    """
    Convert a Python datetime format to a time format suitable for use with
    the datetime picker we use, http://www.malot.fr/bootstrap-datetimepicker/.
    """
    converted = format
    replacements = {'%Y': 'yyyy', '%y': 'yy', '%m': 'mm', '%d': 'dd', '%H':
        'hh', '%I': 'HH', '%M': 'ii', '%S': 'ss'}
    for search, replace in replacements.items():
        converted = converted.replace(search, replace)
    return converted.strip()
