OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 142 Rev 144
Line 36... Line 36...
36
    public LightUIDate(final LightUIDate date) {
36
    public LightUIDate(final LightUIDate date) {
37
        super(date);
37
        super(date);
38
    }
38
    }
39
 
39
 
40
    public Timestamp getValueAsDate() {
40
    public Timestamp getValueAsDate() {
41
        if (this.getValue() != null && this.getValue() != "") {
41
        if (this.getValue() != null && !this.getValue().isEmpty()) {
42
            SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S");
42
            SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S");
43
            try {
43
            try {
44
                return new Timestamp(df2.parse(this.getValue()).getTime());
44
                return new Timestamp(df2.parse(this.getValue()).getTime());
45
            } catch (final ParseException ex) {
45
            } catch (final ParseException ex) {
46
                throw new IllegalArgumentException(ex.getMessage(), ex);
46
                throw new IllegalArgumentException(ex.getMessage(), ex);
Line 64... Line 64...
64
        return this.getValueAsDate();
64
        return this.getValueAsDate();
65
    }
65
    }
66
 
66
 
67
    @Override
67
    @Override
68
    public void _setValueFromContext(Object value) {
68
    public void _setValueFromContext(Object value) {
69
        final String strValue = (String) JSONConverter.getObjectFromJSON(value, String.class);
69
        final String strValue = JSONConverter.getObjectFromJSON(value, String.class);
70
        this.setValue(strValue);
70
        this.setValue(strValue);
71
    }
71
    }
72
 
72
 
73
    @Override
-
 
74
    public LightUIElement clone() {
-
 
75
        return new LightUIDate(this);
-
 
76
    }
-
 
77
}
73
}