Skip to content

nicholasareed/cordova-plugin-datepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DatePicker Plugin for Cordova/PhoneGap 3.0 (iOS and Android)

This is a re-write of the iOS DatePicker plugin hosted on https://github.com/phonegap/phonegap-plugins/tree/master/iOS/DatePicker to run with PhoneGap/Cordova 3.0.

It includes more options and it is ready for iPhone and iPad.

Installation

  1. Make sure that you have Node and Cordova CLI or PhoneGap's CLI or Cordova Plugman installed on your machine.

Also you will need Xcode v.4.2 or newer to support the feature called "Automatic Reference Counting"

  1. Add a plugin to your project using Cordova CLI:
cordova plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker

Or using PhoneGap CLI:

phonegap local plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker
  1. The clobber definition of the plugin is called datePicker. So you can reference to the plugin from anywhere in your code.

Example:

// defining options
var options = {
  date: new Date(),
  mode: 'date'
};
// calling show() function with options and a result handler
datePicker.show(options, function(date){
  console.log("date result " + date);  
});

Check section "Options" below to see all options.

Options

mode

The mode of the date picker.

Typ: String

Values: "date" / "time" / "datetime"

Default: 'datetime'

date

Selected date.

Typ: String

Default: new Date()

allowOldDates

Shows or hide dates earlier then selected date.

Typ: Boolean

Values: true / false

Default: true

allowFutureDates

Shows or hide dates after selected date.

Typ: Boolean

Values: true / false

Default: true

minDate (new)

Minimum date.

Typ: Date or empty String

Default: '' (empty String)

maxDate (new)

Maximum date.

Typ: Date or empty String

Default: '' (empty String)

doneButtonLabel (new)

Label of done button.

Typ: String

Default: 'Done'

doneButtonColor (new)

Hex color of done button.

Typ: String

Default: '#0000FF'

cancelButtonLabel (new)

Label of cancel button.

Typ: String

Default: 'Cancel'

cancelButtonColor (new)

Hex color of cancel button.

Typ: String

Default: '#000000'

x (new)

X position of date picker (iPad only). The position is absolute to the root view of the application.

Typ: String

Default: '0'

y (new)

Y position of date picker (iPad only). The position is absolute to the root view of the application.

Typ: String

Default: '0'

Requirements

  • PhoneGap 3.0 or newer /Cordova 3.0 or newer
  • iOS 5 or newer

Author of migration to PhoneGap 3.0

Jens Krause // WEBSECTOR.DE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 33.5%
  • Objective-C 28.6%
  • Java 26.7%
  • JavaScript 11.2%