Next / Previous / Contents / Shipman's homepage

23.27. MonthCell.monthName(): Translate a month key to a month name (static method)

This static method takes a month key of the form 'yyyy-mm' and returns the corresponding text 'monthName, yyyy'. For the mapping from month numbers to month names, see Section 10.1, “MONTH_NAME_MAP: Translate month numbers to month names”.

noteweb
#   @staticmethod
    def monthName ( yyyy_mm ):
        '''Translate a month key to a month name.

          [ yyyy_mm is a month key as 'yyyy-mm' ->
              return the month name as 'monthName yyyy' ]
        '''
        #-- 1 --
        # [ yyyy  :=  the year part
        #   mm    :=  the month part ]
        #--
        # 01234567
        # yyyy-mm
        #--
        yyyy  =  yyyy_mm[:4]
        mm    =  yyyy_mm[5:7]

        #-- 2 --
        return '%s %s' % (MONTH_NAME_MAP[mm], yyyy)

    monthName  =  staticmethod ( monthName )