Skip to content

rafialikhan/angular-schema-form-datefields

Repository files navigation

angular-schema-form-datefields

An angular schema form - plugin to display datefields. This plugin uses the [Angular Combo Date Picker] (http://jfmdev.github.io/ngComboDatePicker/)

Installation

The easiest way is to install is with bower, this will also include dependencies:

bower install angular-schema-form-datefields --save

Important

As this plugin depends on the ngComboDatePicker, you will need to inject this dependency into your app.js

angular
  .module('otesFormsApp', [
    ...
    'ngComboDatePicker'
  ])

The datefields add-on adds a new form type, datefields.

Form Type Becomes
string datefields
Schema Default Form type
"type": "string" and "format": "datefields" datefields

Options

maxDate is optional, as current year will be taken. Default order is "mdy" (Month Day and Year), dont pass anything if you are ok with this. Options are "ymd","mdy","dmy". Year Order default is ascending, dont pass anything if you are ok with this.

Schema

scope.schema = {
                    "type" : "object",
                    "properties": {
                        "DOB":{
                            "type":"string",
                            "title":"Date of Birth",
                            "format":"datefields",
                            "minDate": "1940-01-01",
                            "maxDate": "2017-01-01",
                            "order": "dmy",
                            "yearOrder": "desc",
                            "required" : "true",
                            "description": "Provide your date in Day / Month / Year format"
                        }
                    },
                    "required": ["DOB"]
            };

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published