'Helper function to retrieve the current options for this
filter widget
@param resource: the S3Resource
@param as_str: return date as ISO-formatted string not raw DateTime'

def _options(self, resource, as_str=True):

    query = resource.get_query()
    rfilter = resource.rfilter
    if rfilter:
        join = rfilter.get_joins()
        left = rfilter.get_joins(left=True)
    else:
        join = left = None
    fields = self.field
    if (type(fields) is list):
        start_field = S3ResourceField(resource, fields[0]).field
        end_field = S3ResourceField(resource, fields[1]).field
        row = current.db(query).select(start_field.min(), start_field.max(), end_field.max(), join=join, left=left).first()
        minimum = row[start_field.min()]
        maximum = row[start_field.max()]
        end_max = row[end_field.max()]
        if end_max:
            maximum = max(maximum, end_max)
    else:
        rfield = S3ResourceField(resource, fields)
        field = rfield.field
        row = current.db(query).select(field.min(), field.max(), join=join, left=left).first()
        minimum = row[field.min()]
        maximum = row[field.max()]
    minute_step = 5
    timedelta = datetime.timedelta
    if minimum:
        minimum -= timedelta(minutes=minute_step)
    if maximum:
        maximum += timedelta(minutes=minute_step)
    if self.opts.get('slider'):
        if (type(fields) is list):
            event_start = fields[0]
            event_end = fields[0]
        else:
            event_start = event_end = fields
        ts = S3TimeSeries(resource, start=minimum, end=maximum, slots=None, event_start=event_start, event_end=event_end, rows=None, cols=None, facts=None, baseline=None)
        data = ts.as_dict()
        data = data['p']
        ts = [(v['t'][0], v['v'][0]) for v in data]
    else:
        ts = []
    if as_str:
        ISO = '%Y-%m-%dT%H:%M:%S'
        if minimum:
            minimum = minimum.strftime(ISO)
        if maximum:
            maximum = maximum.strftime(ISO)
    return (minimum, maximum, ts)
