TimePicker

<TimePicker> is a UI component that lets users select time.

See also: DatePicker.


  • Angular

  • HTML

  • TypeScript

<TimePicker
  hour="9"
  minute="25"
  maxHour="23"
  maxMinute="59"
  minuteInterval="5"
  (timeChange)="onTimeChanged($event)"
>
</TimePicker>
import { Component } from '@angular/core'
import { TimePicker } from '@nativescript/core'

@Component({
  moduleId: module.id,
  templateUrl: './usage.component.html'
})
export class UsageComponent {
  todayObj: Date = new Date()

  onTimeChanged(args) {
    const tp = args.object as TimePicker

    const time = args.value
    console.log(`Chosen time: ${time}`)
  }
}

Props

Name Type Description

hour

Number

Gets or sets the selected hour.

minute

Number

Gets or sets the selected minute.

time

Date

Gets or sets the selected time.

minHour

Number

Gets or sets the minimum selectable hour.

maxHour

Number

Gets or sets the maximum selectable hour.

minMinute

Number

Gets or sets the minimum selectable minute.

maxMinute

Number

Gets or sets the maximum selectable minute.

minuteInterval

Number

Gets or sets the selectable minute interval. For example: 5 or 15 minutes. + Default value: 1.

...Inherited

Inherited

Additional inherited properties are not shown. Refer to the API Reference

Events

Name Description

timeChange

Emitted when the selected time changes.

Native component