DatePicker iOS Plugin for using PhoneGap / Cordova 3.0

❗️ [Note] This project is deprecated and will be continued by https://github.com/VitaliiBlagodir/cordova-plugin-datepicker

DatePicker iOS Plugin for using PhoneGap / Cordova 3.0

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 using on iPhone and iPad.

Note: iOS6 only! For using iOS7 checkout the ios7 branch

Screen shots

iPhone

screen shot iPhone

iPad

screen shot 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/sectore/phonegap3-ios-datepicker-plugin

Or using PhoneGap CLI:

phonegap local plugin add https://github.com/sectore/phonegap3-ios-datepicker-plugin

Or using plugman CLI:

plugman --platform ios --project ./platforms/ios --plugin https://github.com/sectore/phonegap3-ios-datepicker-plugin

3a) Register plugin within config.xml of your app

<feature name="DatePicker">
    <param name="ios-package" value="DatePicker"/>
</feature>

3b) If you are using PhoneGap build service add to config.xml

<gap:plugin name="de.websector.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/6

Author of migration to PhoneGap 3.0

Jens Krause // WEBSECTOR.DE

Bitdeli Badge

转载于:https://my.oschina.net/u/199525/blog/1554858

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: my97datepicker/4.8/wdatepicker.js是一个用于实现日期选择的JavaScript插件。它基于My97 DatePicker开发,提供了丰富的日期选择功能和样式定制选项。 这个插件可以用于网页中的日期选择控件,使用户能够方便地从一个日历中选择日期。它可以用于各种场景,比如用户生日选择、预定会议时间、预约医生等。在使用这个插件之前,需要在页面中引入相应的JavaScript文件,并将日期选择控件的HTML元素与插件绑定。 wdatepicker.js提供了一些日期选择的基本功能,比如切换月份、选择日期、上下翻页等。它还可以根据具体需求进行样式定制,包括日期的外观、选择范围、禁用某些日期等。通过设置插件的参数,可以实现个性化和灵活的日期选择控件。 这个插件还支持多种日期格式的输入和显示,可以根据需要自定义日期的显示方式。同时,它还提供了一些常用的日期操作和计算功能,比如获取当前日期、判断两个日期的大小比较等。 总之,my97datepicker/4.8/wdatepicker.js是一个功能丰富、灵活易用的日期选择插件,可以帮助开发人员简化日期选择的操作,提高用户体验。无论在哪个行业或场景中使用,都可以在网页中轻松实现日期选择的功能。 ### 回答2: my97datepicker/4.8/wdatepicker.js是一个用于日期选择的Javascript插件。该插件基于My97DatePicker,提供了丰富的日期选择功能和样式定制选项。 使用该插件,可以在网页中方便地添加日期选择器,让用户可以直接从日历中选择日期。日期选择器可以显示当前日期、月份和年份,用户可以通过点击日历上的日期来选择特定日期。该插件还支持快捷选择功能,例如可以选择某个月的第一天或最后一天。 此外,wdatepicker.js还具有一些其他的特性,例如可以禁用特定日期,设置日期的最大和最小可选范围,以及自定义日期的显示格式。插件还支持多语言,可以根据需要切换不同的语言版本。 对于开发人员来说,wdatepicker.js提供了丰富的API接口,可以通过编程方式控制日期选择器的行为。可以动态设置日期选择器的默认日期、最大最小可选范围、显示格式等。此外,还可以通过回调函数来处理用户选择日期后的操作。 总之,my97datepicker/4.8/wdatepicker.js是一个功能强大、灵活易用的日期选择插件,可以方便地在网页中添加日期选择功能,提升用户体验。 ### 回答3: my97datepicker/4.8/wdatepicker.js 是一个用于日期选择的JavaScript插件。该插件是基于My97 DatePicker开发的,用于在网页中添加日期选择功能。 使用该插件前,你需要在网页中引入wdatepicker.js文件。然后,可以在需要添加日期选择的文本框或其他元素上调用相关的函数,以创建一个日历窗口。 该插件提供了丰富的功能,包括日期选择、时间选择、范围选择等。你可以自定义日历的外观和行为,通过传递不同的参数来实现不同的效果。 在使用过程中,你可以根据自己的需求,设置日期的格式、起始日期、语言等。同时,该插件还提供了一些事件回调函数,用于处理日期选择后的操作。 wdatepicker.js兼容多种浏览器,包括IE、火狐、谷歌等主流浏览器,可以在各种网页项目中灵活使用。 总的来说,my97datepicker/4.8/wdatepicker.js 是一个方便实用的日期选择插件,可以轻松地在网页中添加日期选择功能,提升用户体验。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值