3.0.8 • Published 12 months ago

@aurelia-toolkit/mdc-datepicker v3.0.8

Weekly downloads
90
License
MIT
Repository
github
Last release
12 months ago

Aurelia MDC Datepicker

npm version

Installation

npm @aurelia-toolkit/mdc-datepicker date-fns inputmask @aurelia-toolkit/mdc-inputmask --save

If only the dialog is used inputmask and @aurelia-toolkit/mdc-inputmask may be ommited. You will get peer dependency warnings which can be ignored.

Configuration

// main.ts
export function configure(aurelia: Aurelia) {
    aurelia.use.plugin(PLATFORM.moduleName('@aurelia-toolkit/mdc-datepicker'), (c: MdcDatepickerDialogConfiguration) => {
      // the dialog is localised via default options
      c.defaultOptions.i18n.dateFnsLocale = enAU;
      c.defaultOptions.firstDay = 1;
    });
    // the rest of your configuration...
}
// main.scss
@use "@aurelia-toolkit/mdc-datepicker";

Usage

<mdc-datepicker value.bind="date" format="dd/MM/yyyy" inputmask-format="dd/mm/yyyy"></mdc-datepicker>
<!-- format attribute accepts date-fns format tokens  -->
<!-- inputmask-format attribute accepts inputmask format tokens  -->

mdc-datepicker custom element uses inputmask to limit user's input. You can use the datepicker dialog separately via the MDC dialog service

const dialogService: MdcDialogService;
const data: Partial<IMdcDatepickerDialogData> = {
  date: this.getDateValue(),
  options: {
    label: 'Select Date'
  }
};
const result = await dialogService.open({ viewModel: MdcDatepickerDialog, model: data });
if (result === 'ok') {
  console.log(data.date);
}

Contribution

If you feel that something is missing please submit an issue or better yet a PR.

3.0.8

12 months ago

3.0.7

12 months ago

3.0.4

2 years ago

3.0.6

1 year ago

3.0.5

2 years ago

3.0.3

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.5

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago