Options
All
  • Public
  • Public/Protected
  • All
Menu

A class with SortEvent functions and functions which accept other SortEvents and return a new SortEvent.

// Sorts full day events first, then events in descending order based on start time.
Sorts.List([Sorts.FullDay, Sorts.Desc(Sorts.Start)]);

Hierarchy

  • Sorts

Index

Methods

Static Alphabetical

  • Alphabetical<T, M>(getString: function): SortEvent<T, M>
  • Returns a SortEvent that orders the events based on a string in each event. A function must be supplied which takes an event of type T and returns a string.

    Type parameters

    • T

    • M

    Parameters

    • getString: function

      A function which returns a string from the event.

        • (event: Event<T, M>): string
        • Parameters

          Returns string

    Returns SortEvent<T, M>

    A sorter which sorts strings alphabetically.

Static Desc

  • Returns a SortEvent that effectively orders the given sorter in the opposite (often descending) order.

    Type parameters

    • T

    • M

    Parameters

    • sorter: SortEvent<T, M>

      The sorter to reverse.

    Returns SortEvent<T, M>

    A new sorter which reverses the one passed in.

Static Duration

  • Sorts the two events placing the shorter events before the longer events. Full day or multiple day events actually take up a day and will be ordered last.

    see

    CalendarEvent.time

    see

    DaySpan.millis

    Type parameters

    • T

    • M

    Parameters

    Returns number

    The difference in milliseconds between a and b.

Static End

  • Sorts the two events by their end time - the earliest to end being first in order.

    see

    CalendarEvent.time

    Type parameters

    • T

    • M

    Parameters

    Returns number

    The difference in time between the end of a and b.

Static FullDay

  • Sorts the two events placing the full day events before the timed events.

    see

    CalendarEvent.fullDay

    Type parameters

    • T

    • M

    Parameters

    Returns number

    If both are timed or both are full day then 0 is returned, otherwise -1 is returned if a is full day and 1 is returned if b is full day.

Static List

  • Returns a SortEvent that orders events based on an array of sorters. The first sorter which returns a non-zero result is used.

    Type parameters

    • T

    • M

    Parameters

    • sorters: SortEvent<T, M>[]

      A list of sorting functions to test one at a time.

    Returns SortEvent<T, M>

    A sorter which sorts based on a list of sorters.

Static Ordered

  • Ordered<T, M>(getOrder: function): SortEvent<T, M>
  • Returns a SortEvent that orders events based on a number in each event. A function must be supplied which takes an event of type T and returns a number.

    Type parameters

    • T

    • M

    Parameters

    • getOrder: function

      A function which returns a number from the event.

        • (event: Event<T, M>): number
        • Parameters

          Returns number

    Returns SortEvent<T, M>

    A sorter which sorts events based on a number in ascending order.

Static Start

  • Sorts the two events by their start time - the earliest event being first in order.

    see

    CalendarEvent.time

    Type parameters

    • T

    • M

    Parameters

    Returns number

    The difference in time between the start of a and b.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc