Project

General

Profile

« Previous | Next » 

Revision 5b81fd8a

Added by Andreas Kohlbecker almost 7 years ago

ref #6564 TimePeriodFormatter bugfix: support for freetext added

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/util/TimePeriodFormatter.java
8 8
*/
9 9
package eu.etaxonomy.cdm.vaadin.util;
10 10

  
11
import org.apache.commons.lang.StringUtils;
11 12
import org.joda.time.Partial;
12 13
import org.joda.time.format.DateTimeFormatter;
13 14
import org.joda.time.format.ISODateTimeFormat;
......
39 40

  
40 41
    public String print(TimePeriod timePeriod) {
41 42

  
42
        switch (format) {
43
        case ISO8601:
44
        default:
45
            return printISO8601(timePeriod);
43
        if ( StringUtils.isNotBlank(timePeriod.getFreeText())){
44
           return timePeriod.getFreeText();
45
        }else{
46
            switch (format) {
47
            case ISO8601:
48
            default:
49
                return printISO8601(timePeriod);
50
            }
46 51
        }
47 52
    }
48 53

  

Also available in: Unified diff