Exemple #1
0
    def _pretty_date(date):
        """
        Format a timestamp into a human friendly format.

        It uses :py:func:`invenio.utils.date.pretty_date`
        """
        if isinstance(date, datetime) or isinstance(date, string_types):
            return pretty_date(
                date, ln=getattr(g, 'ln', app.config['CFG_SITE_LANG']))
        return date
Exemple #2
0
    def _pretty_date(date):
        """
        Format a timestamp into a human friendly format.

        It uses :py:func:`invenio.utils.date.pretty_date`
        """
        from invenio_utils.date import pretty_date
        if isinstance(date, datetime) or isinstance(date, string_types):
            return pretty_date(
                date, ln=getattr(g, 'ln', app.config['CFG_SITE_LANG']))
        return date
Exemple #3
0
def get_pretty_date(bwo):
    """Get the pretty date from bwo.created."""
    from invenio_utils.date import pretty_date
    return pretty_date(bwo.created)