Example usage for org.joda.time TimeOfDay MIDNIGHT

List of usage examples for org.joda.time TimeOfDay MIDNIGHT

Introduction

In this page you can find the example usage for org.joda.time TimeOfDay MIDNIGHT.

Prototype

TimeOfDay MIDNIGHT

To view the source code for org.joda.time TimeOfDay MIDNIGHT.

Click Source Link

Document

Constant for midnight.

Usage

From source file:pt.ist.fenixWebFramework.rendererExtensions.DurationRenderer.java

License:Open Source License

@Override
protected Layout getLayout(Object object, Class type) {
    duration = (Duration) object;
    DateTime dateTime = TimeOfDay.MIDNIGHT.toDateTimeToday().plus(duration.toPeriod());
    final Date date = dateTime != null ? convertDateTimeToCalendar(dateTime).getTime() : null;

    final Layout superLayout = super.getLayout(date, type);

    return new Layout() {

        @Override/*w w  w  .j a v a  2s.com*/
        public HtmlComponent createComponent(Object object, Class type) {
            HtmlText text = (HtmlText) superLayout.createComponent(date, type);

            String formatText = isShowFormat() ? " (" + getFormat() + ")" : "";
            text.setText(text.getText() + formatText);

            return text;
        }

    };
}