Skip to content

Instantly share code, notes, and snippets.

import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class extends Component {
@action
changeParam(number, event) {
const params = this.args.param.slice(0);
if (event.target.checked) {
params.pushObject(number);
interface Time {
hour: string,
minute: string,
dayPeriod: string
}
someFunction(dateParts: Intl.DateTimeFormatPart[]): Time {
const {hour, minute, dayPeriod} =
dateParts.reduce(
(time, part) => (time[part.type] = part.value, time),