Skip to content

issues with time values over 24 hours #393

Description

@PeterFokkinga

In release 0.12 OdfTableCell.getTimeValue() will return a Calendar object representing a time longer than 24 hours just fine.

The current master branch however getTimeValue() will log SEVERE: Text 'PT26H33M12.13S' could not be parsed: Invalid value for HourOfDay (valid values 0 - 23): 26 and return null

Neither version will write a time over 24 hours

 Calendar cal = Calendar.getInstance();
 cal.add(Calendar.HOUR, 26);
 fcell.setTimeValue(cal)

Will result in a cell with value PT02H00M00S visible to the user as 2 hours.

I have code for new getDurationValue and setDurationValue methods (for Java 8 Duration); using that would also fix the regression in getTimeValue()

But what about setTimeValue? I feel the 0.12 behaviour is wrong and should be fixed, but people may now expect this behaviour and the method is now deprecated anyway.

Let me know if you'd like a PR for supporting Duration and whether the PR should change the behaviour of setTimeValue or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions