OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 180
Line 63... Line 63...
63
        }
63
        }
64
    }
64
    }
65
 
65
 
66
    @Override
66
    @Override
67
    public String format(Object o, CellStyle defaultStyle, boolean lenient) {
67
    public String format(Object o, CellStyle defaultStyle, boolean lenient) {
-
 
68
        final Duration d;
-
 
69
        if (o instanceof Calendar)
68
        final Duration d = o instanceof Calendar ? TimeUtils.timePartToDuration((Calendar) o) : (Duration) o;
70
            d = TimeUtils.timePartToDuration((Calendar) o);
-
 
71
        else if (o instanceof java.time.Duration)
-
 
72
            d = TimeUtils.getTypeFactory().newDurationDayTime(o.toString());
-
 
73
        else
-
 
74
            d = (Duration) o;
69
        final Namespace numberNS = this.getElement().getNamespace();
75
        final Namespace numberNS = this.getElement().getNamespace();
70
        final StringBuilder sb = new StringBuilder();
76
        final StringBuilder sb = new StringBuilder();
71
 
77
 
72
        final Locale styleLocale = this.getLocale();
78
        final Locale styleLocale = this.getLocale();
73
        final boolean truncate = StyleProperties.parseBoolean(getElement().getAttributeValue("truncate-on-overflow", numberNS), true);
79
        final boolean truncate = StyleProperties.parseBoolean(getElement().getAttributeValue("truncate-on-overflow", numberNS), true);