fng-ui-date

0.12.0-beta.271 • Public • Published

fng-ui-date

Plugin for forms-angular that adds jQuery UI date picker.

Usage

npm install fng-ui-date

To get all the dependencies at the top level of your node_modules run

npm dedupe

Add the following lines to your index.html (or equivalent) file

<link rel="stylesheet" href="jquery-ui/themes/smoothness/jquery-ui.css">
<script src="angular-ui-date/dist/date.js"></script>

Date fields in models will have the date picker added.

Configuration

Configure as part of your Angular app configuration as follows:

    myApp.config(['uiDateConfig', function(uiDateConfig) {
      angular.extend(uiDateConfig, {
        dateFormat: 'dd/mm/yy',             // UK date format
        firstDay: 1                         // Monday week start
      });
    }]);

For detailed options see the documentation at http://jqueryui.com/datepicker/

You can specify the timezone (useful to specify UTC for dates of birth and other 'floating' dates) using the schema form.add property:

  dateOfBirth: {type: Date, form: {add: ' ng-model-options="{timezone:\'UTC\'}" '}}  

(see the dateOfBirth property in this schema for an example)

Readme

Keywords

Package Sidebar

Install

npm i fng-ui-date

Weekly Downloads

34

Version

0.12.0-beta.271

License

MIT

Unpacked Size

3.47 kB

Total Files

4

Last publish

Collaborators

  • mchapman