Colection of aurelia resorces, using Aurelia CLI.
attributes
- datepicker : jquery ui datepicker aurelia attribute
datepicker
-
Source was based on sample xreated by Jeremy Danyow (link: https://www.danyow.net/jquery-ui-datepicker-with-aurelia/) Added functionality to set options to jQuery datepicker ui widget.
-
Configurarions an settings required:
- required modules:
- jquery
- jquery-ui use "npm install" command for each one.
-
Aurelia configuration: (aurelia.jason) Add to aurelia.json, at "dependencies" section the following: "jquery", { "name": "jquery-datepicker", "path": "../node_modules/jquery-ui", "main": "ui/widgets/datepicker", "deps": ["jquery"], "exports": "$" },
-
jQuery-UI CSS Add to header section of index.html file, located at root project, the following tag:
-
Install custom attribute Copy datepicker.js to src/resources/attributes directory Edit index.js file, located at src/resources, and add a reference to datepicker.js: config.globalResources(['./attributes/datepicker']);
-
Using attribute To use on your page, just add the "datepicker" attribute tou your input control:
- Seting options. You can use any of the options avaiable on jQuery-ui datepicker widget. Example for dateFormat: