'Convert datetime.timedelta to "HH:MM:SS" format.
If not value, return "00:00:00"
Backward compatibility: check if value is float, and convert it. No exceptions here.
If value is not float, but is exceed 23:59:59, raise exception.'

def to_json(self, value):

    if (not value):
        return '00:00:00'
    if isinstance(value, float):
        value = min(value, 86400)
        return self.timedelta_to_string(datetime.timedelta(seconds=value))
    if isinstance(value, datetime.timedelta):
        if (value.total_seconds() > 86400):
            raise ValueError('RelativeTime    max    value    is    23:59:59=86400.0    seconds,    but    {}    seconds    is    passed'.format(value.total_seconds()))
        return self.timedelta_to_string(value)
    raise TypeError('RelativeTime:    cannot    convert    {!r}    to    json'.format(value))
