Skip to content

Commit

Permalink
chore: datetime-picker TS
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed May 15, 2024
1 parent 587679a commit eb31476
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @format */
import angular from "angular"
import angular, { type IComponentController, type IScope } from "angular"
import { html } from "@/util"
import moment, { type Moment } from "moment"

angular.module("korpApp").component("datetimePicker", {
template: html`
Expand Down Expand Up @@ -47,8 +48,8 @@ angular.module("korpApp").component("datetimePicker", {
},
controller: [
"$scope",
function ($scope) {
const $ctrl = this
function ($scope: DatetimePickerScope) {
const $ctrl = this as DatetimePickerController

$ctrl.$onInit = () => {
// Sync incoming values to internal model
Expand Down Expand Up @@ -85,3 +86,19 @@ angular.module("korpApp").component("datetimePicker", {
},
],
})

type DatetimePickerController = IComponentController & {
label: string
dateModel: Date
timeModel: Date
minDate: Date
maxDate: Date
update: (values: { m: Moment }) => void
}

type DatetimePickerScope = IScope & {
date: Date
time: Date
combined: Moment
handleClick: (event: JQuery.ClickEvent) => void
}

0 comments on commit eb31476

Please sign in to comment.