Skip to content

Instantly share code, notes, and snippets.

@leetheguy
Last active May 31, 2019 20:16
Show Gist options
  • Select an option

  • Save leetheguy/16b46c4074e660c2ab35aae372f3ca35 to your computer and use it in GitHub Desktop.

Select an option

Save leetheguy/16b46c4074e660c2ab35aae372f3ca35 to your computer and use it in GitHub Desktop.
import { Component, Prop, Event, EventEmitter } from '@stencil/core';
import '@ionic/core';
@Component({
tag: 'time-zone-slider'
})
export class TimeZoneSlider {
@Prop() offset: number;
@Event() timeZoneChanged: EventEmitter;
positionChanged(event: CustomEvent) {
this.timeZoneChanged.emit(event.detail.value)
}
render() {
return (
<ion-range
debounce={500}
max={12}
min={-12}
pin={true}
snaps={true}
step={1}
value={this.offset}
onIonChange={event => this.positionChanged(event)}
>
<ion-label slot="start">-12</ion-label>
<ion-label slot="end">12</ion-label>
</ion-range>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment