Flask application initialization.

        :param app: The Flask application.

def init_app(self, app):
        """Flask application initialization.

        :param app: The Flask application.
        """
        self.init_config(app)

        # Install datetime helpers.
        app.jinja_env.filters.update(
            from_isodate=from_isodate,
            from_isodatetime=from_isodatetime,
            to_arrow=to_arrow,
            format_arrow=format_arrow,
        )

        if app.config['FORMATTER_BADGES_ENABLE']:
            from invenio_formatter.context_processors.badges import \
                badges_processor

            # Registration of context processors.
            app.context_processor(badges_processor)
            # Register blueprint.
            app.register_blueprint(create_badge_blueprint(
                app.config['FORMATTER_BADGES_ALLOWED_TITLES']))

        app.extensions['invenio-formatter'] = self