code: def babel2datepicker(pattern):
      
      if not isinstance(pattern, DateTimePattern):
          pattern = parse_pattern(pattern)
  
      map_fmt = {
          # days
          "d": "dd",
          "dd": "dd",
          "EEE": "D",
          "EEEE": "DD",
          "EEEEE": "D",  # narrow name => short name
          # months
          "M": "mm",
          "MM": "mm",
          "MMM": "M",
          "MMMM": "MM",
          # years
          "y": "yyyy",
          "yy": "yyyy",
          "yyy": "yyyy",
          "yyyy": "yyyy",
          # time picker format
          # hours
          "h": "%I",
          "hh": "%I",
          "H": "%H",
          "HH": "%H",
          # minutes,
          "m": "%M",
          "mm": "%M",
          # seconds
          "s": "%S",
          "ss": "%S",
          # am/pm
          "a": "%p",
      }
  
      return pattern.format % map_fmt
docs: Convert date format from babel (http://babel.pocoo.org/docs/dates/#date-
      fields)) to a format understood by bootstrap-datepicker.