Object

com.mediative.amadou

Week

Related Doc: package amadou

Permalink

object Week extends DateIntervalType

ISO 8601 week. Note that it has some counterintuitive behavior around new year. For instance Monday 29 December 2008 is week 2009-W01, and Sunday 3 January 2010 is week 2009-W53-7 This example was taken from from http://en.wikipedia.org/wiki/ISO_8601#Week_dates:

scala> Week(Day(2008, 12, 29))
res1: DateInterval = 2009-W01
scala> Week(Day(2010, 1, 3))
res2: DateInterval = 2009-W53
scala> Week(2009, 53, dayOfWeek = Week.Sunday).by(Day).last
res3: DateInterval = 2010-01-03
Source
DateInterval.scala
Linear Supertypes
DateIntervalType, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Week
  2. DateIntervalType
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait WeekDay extends AnyRef

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Friday extends WeekDay with Product with Serializable

    Permalink
  5. object Monday extends WeekDay with Product with Serializable

    Permalink
  6. object Saturday extends WeekDay with Product with Serializable

    Permalink
  7. object Sunday extends WeekDay with Product with Serializable

    Permalink
  8. object Thursday extends WeekDay with Product with Serializable

    Permalink
  9. object Tuesday extends WeekDay with Product with Serializable

    Permalink
  10. object Wednesday extends WeekDay with Product with Serializable

    Permalink
  11. def apply(year: Int, week: Int, dayOfWeek: WeekDay = Monday): DateInterval

    Permalink
  12. def apply(timestamp: Long): DateInterval

    Permalink

    Represent the interval for a given timestamp using the specified interval type.

    Represent the interval for a given timestamp using the specified interval type.

    This will truncate lower resolution date fields to their initial value, for example for months the day of month field is set to 1.

    Example:

    scala> Day(1431000000000L).format("yyyy-MM-dd HH:mm ZZ")
    res1: String = 2015-05-07 00:00 +0000
    scala> Month(1431000000000L).format("yyyy-MM-dd HH:mm ZZ")
    res2: String = 2015-05-01 00:00 +0000
    scala> Year(1431000000000L).format("yyyy-MM-dd HH:mm ZZ")
    res3: String = 2015-01-01 00:00 +0000
    Definition Classes
    DateIntervalType
  13. def apply(date: DateInterval): DateInterval

    Permalink

    Create a date interval with a different type and truncate lower resolution date fields accordingly.

    Create a date interval with a different type and truncate lower resolution date fields accordingly.

    Example:

    scala> Day(1431000000000L)
    res1: DateInterval = 2015-05-07
    scala> Week(Day(1431000000000L))
    res2: DateInterval = 2015-W19
    scala> Month(Day(1431000000000L))
    res3: DateInterval = 2015-05
    scala> Quarter(1431000000000L)
    res4: DateInterval = 2015-Q2
    scala> Year(Day(1431000000000L))
    res5: DateInterval = 2015
    scala> Year(Day(1431000000000L)).format("yyyy-MM-dd HH:mm ZZ")
    res6: String = 2015-01-01 00:00 +0000
    Definition Classes
    DateIntervalType
  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. val calendarField: Int

    Permalink
    Definition Classes
    DateIntervalType
  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. val dateFormat: String

    Permalink
    Definition Classes
    DateIntervalType
  18. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def parse(input: String): Option[DateInterval]

    Permalink

    Parse a timestamp into a date interval.

    Parse a timestamp into a date interval.

    Example:

    scala> Day.parse("2015-05-07")
    res1: Option[DateInterval] = Some(2015-05-07)
    scala> Day.parse("2015-05-07").get.format("yyyy-MM-dd HH:mm ZZ")
    res2: String = 2015-05-07 00:00 +0000
    Definition Classes
    DateIntervalType
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. def today: DateInterval

    Permalink

    Represent the interval for today using the specified interval type.

    Represent the interval for today using the specified interval type.

    This will truncate lower resolution date fields to their initial value, for example for months the day of month field is set to 1.

    Definition Classes
    DateIntervalType
  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DateIntervalType

Inherited from AnyRef

Inherited from Any

Ungrouped