Interface IDatePicker<TEvent, TNative, TMobile>

Type Parameters

Hierarchy

Properties

nativeObject: TNative
ios: TMobile["ios"]
android: TMobile["android"]

Methods

  • Sets the initial date avaliable on the picker.

    Method

    setDate

    Android

    Ios

    Since

    0.1

    Parameters

    • date: Date

    Returns void

  • Sets the minimum date avaliable on the picker.

    Method

    setMinDate

    Android

    Ios

    Since

    0.1

    Parameters

    • date: Date

    Returns void

  • Sets the maximum date avaliable on the picker.

    Method

    setMaxDate

    Android

    Ios

    Since

    0.1

    Parameters

    • date: Date

    Returns void

  • Makes the picker appear on the screen.

    Method

    show

    Android

    Ios

    Since

    0.1

    Returns void

  • Creates an event emitter instance to listen for the actions

    Returns

    Call the function to remove the event

    Parameters

    • eventName: "selected"
    • callback: (() => void)

      Gets as any arguments as it needs

        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "cancelled"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: TEvent
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Removes the specified event and invokes the callback after it is removed

    Parameters

    • eventName: "selected"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "cancelled"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: TEvent
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Triggers the event manually.

    Parameters

    • eventName: "selected"

    Returns void

  • Parameters

    • eventName: "cancelled"

    Returns void

  • Parameters

    • eventName: TEvent
    • Rest ...args: any[]

    Returns void

  • Creates an event emitter instance to listen for the actions

    Returns

    Call the function to remove the event

    Parameters

    • eventName: "selected"
    • callback: (() => void)

      Gets as any arguments as it needs

        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "cancelled"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: TEvent
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

    Parameters

    • eventName: "selected"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "cancelled"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: TEvent
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

    Parameters

    • eventName: "selected"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "cancelled"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: TEvent
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

Events

onDateSelected: ((date: Date) => void)

Type declaration

    • (date: Date): void
    • Triggered when a date is selected on the picker.

      Since

      0.1

      Deprecated

      Android

      Ios

      Example

      import DatePicker from '@smartface/native/ui/datepicker';

      const datePicker = new DatePicker();
      datePicker.on(DatePicker.Events.Selected, (params) => {
      console.info('onDateSelected', params);
      });

      Parameters

      • date: Date

        onDateSelected

      Returns void

onCancelled: (() => void)

Type declaration

    • (): void
    • Triggered when click cancel button on the picker.

      Since

      3.1.3 onCancelled

      Deprecated

      Android

      Ios

      Example

      import DatePicker from '@smartface/native/ui/datepicker';

      const datePicker = new DatePicker();
      datePicker.on(DatePicker.Events.Cancelled, () => {
      console.info('onCancelled');
      });

      Returns void

Generated using TypeDoc