- Index
- »
- fan.haystack
- »
- Span
Span
@Js
const class Span : Obj
Span models a range of time using an inclusive starting timestamp and exclusive ending timestamp.
Decode from string format
Make an absolute span for two date times which must be defined in the Rel timezone
Make a relative span for given mode using current time and current locale for starting weekday
Make an absolute span for the given date
Absolute or relative mode
Inclusive starting timestamp
Exclusive ending timestamp
Encode to string, see fromStr
Return axon representation for this span
Timezone for this span
Equality is based on mode only for relative, start/end for abs
Convenience for Span(SpanMode.today)
Convert to timezone using DateTime.toTimeZone on both start, end
Convert this span to a DateSpan attempting to use aligned dates
Hash code is based on mode only for relative, start/end for abs
Display string for current locale
Str dis()
Display string for current locale
const DateTime : end
Exclusive ending timestamp
virtual Bool equals(Obj? obj)
Equality is based on mode only for relative, start/end for abs
static new fromStr(Str str, TimeZone tz, Bool checked)
Decode from string format:
- relative SpanMode mode name
- absolute single date:
YYYY-MM-DD - absolute date span:
YYYY-MM-DD,YYYY-MM-DD - absolute date time span:
YYYY-MM-DDThh:mm:ss.FFF zzzz,YYYY-MM-DDThh:mm:ss.FFF zzzz
virtual Int hash()
Hash code is based on mode only for relative, start/end for abs
static new makeAbs(DateTime start, DateTime end)
Make an absolute span for two date times which must be defined in the Rel timezone
static new makeDate(Date date, TimeZone tz)
Make an absolute span for the given date
static new makeRel(SpanMode mode, TimeZone tz)
Make a relative span for given mode using current time and current locale for starting weekday
const SpanMode : mode
Absolute or relative mode
const DateTime : start
Inclusive starting timestamp
Str toCode()
Return axon representation for this span.
DateSpan toDateSpan()
Convert this span to a DateSpan attempting to use aligned dates
virtual Str toStr()
Encode to string, see fromStr
Span toTimeZone(TimeZone tz)
Convert to timezone using DateTime.toTimeZone on both start, end
static Span today(TimeZone tz)
Convenience for Span(SpanMode.today)
TimeZone tz()
Timezone for this span