Code Monkey home page Code Monkey logo

angular-schema-form-datetimepicker's Introduction

date/time picker add-on

This date/time picker add-on uses the angular-strap plugin to provide a datepicker or a timepicker interface. angular-strap is used.

This add-on takes options object via dateOptions, timeOptions and options in the form. More info below at Options.

Installation

The editor is an add-on to the Bootstrap decorator. To use it, just include schema-form-date-time-picker.min.js.

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

$ bower install chengz/schema-form-datetimepicker

You'll need to load a few additional files to use the editor:

Be sure to load this projects files after you load angular schema form

Example

<script type="text/javascript" src="/bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src='bower_components/angular-strap/dist/angular-strap.min.js'></script>
<script src='bower_components/angular-strap/dist/angular-strap.tpl.min.js'></script>
<script src="bower_components/tv4/tv4.js"></script>
<script src="bower_components/objectpath/lib/ObjectPath.js"></script>
<script src="bower_components/angular-schema-form/dist/schema-form.min.js"></script>
<script src="bower_components/angular-schema-form/dist/bootstrap-decorator.min.js"></script>
<script src="schema-form-date-time-picker.js"></script>

When you create your module, be sure to depend on this project's module as well.

angular.module('yourModule', ['schemaForm', 'schemaForm-datepicker', 'schemaForm-timepicker', 'schemaForm-datetimepicker']);

Usage

The add-on adds three new form type, datepicker, timepicker, datetimepicker, and three new default mappings.

Schema Default Form type
"type": "string" and "format": "datepicker" datepicker
"type": "string" and "format": "timepicker" timepicker
"type": "string" and "format": "datetimepicker" datetimepicker

Options

datepicker

The datepicker form takes one option, dateOptions. This is an object with any and all options availible to angular-strap datepicker.

Example

{
  "key": "publish_date",
  "dateOptions": {
    "minDate": new Date(),
    "maxDate": $scope.$eval("model.some_other_date")
  }
},

timepicker

The timepicker form takes one option, timeOptions. This is an object with any and all options availible to angular-strap timepicker.

Example

{
  "key": "publish_time",
  "dateOptions": {
    "minuteStep": 15,
    "autoclose": 1
  }
},

datetimepicker

The datetimepicker form takes one option, options. This is an object with any and all options availible to angular-strap datepicker and timepicker.

Example

{
  "key": "publish_at",
  "options": {
    "minDate": new Date(),
    "minuteStep": 15,
    "autoclose": 1
  }
},

angular-schema-form-datetimepicker's People

Contributors

chengz avatar dmtw avatar minisai avatar stevehu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.