https://github.com/hansemannn/titanium-calendar
An easy to use iOS modal calendar for selecting dates. Based on the awesome PDTSimpleCalendar library.
https://github.com/hansemannn/titanium-calendar
calendar javascript native titanium
Last synced: 8 months ago
JSON representation
An easy to use iOS modal calendar for selecting dates. Based on the awesome PDTSimpleCalendar library.
- Host: GitHub
- URL: https://github.com/hansemannn/titanium-calendar
- Owner: hansemannn
- Created: 2018-11-25T19:32:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-25T10:24:55.000Z (over 3 years ago)
- Last Synced: 2025-03-29T01:12:30.396Z (about 1 year ago)
- Topics: calendar, javascript, native, titanium
- Language: Objective-C
- Homepage:
- Size: 3.97 MB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Titanium Calendar
An easy to use iOS modal calendar for selecting dates. Based on the awesome [PDTSimpleCalendar](https://github.com/jivesoftware/PDTSimpleCalendar) library.

## Features
1. Show the calendar modally
2. Show the calendar in a view of your desire
## Examples
### Calendar Dialog (modally)
```js
var TiCalendar = require('ti.calendar');
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var button = Ti.UI.createButton({
title: 'Show calendar'
});
win.add(button);
const calendar = TiCalendar.createCalendar({
// All optional
title: L('Select Date', 'Select Date'),
value: new Date(),
circleBackgroundColor: '#fff',
circleSelectedBackgroundColor: '#f00',
textColor: '#000',
textSelectedColor: '#fff',
todayTextColor: '#333',
todayCircleBackgroundColor: '#dbdbdb'
});
calendar.addEventListener('change', function() {
calendar.hide();
});
button.addEventListener('click', function() {
calendar.show();
});
win.open();
```
### Calendar View
```js
var TiCalendar = require('ti.calendar');
var selectedDate = new Date();
var win = Ti.UI.createWindow({
title: 'Select Date',
backgroundColor: '#fff'
});
var button = Ti.UI.createButton({
title: 'Show calendar'
});
win.add(button);
button.addEventListener('click', function() {
const calendar = TiCalendar.createCalendarView({
title: 'Select Date',
value: selectedDate,
circleBackgroundColor: '#fff',
circleSelectedBackgroundColor: '#f00',
textColor: '#000',
textSelectedColor: '#fff',
todayTextColor: '#333',
todayCircleBackgroundColor: '#dbdbdb'
});
calendar.addEventListener('change', function(e) {
Ti.API.warn('Selected date: ' + e.date);
selectedDate = e.date;
});
var win2 = Ti.UI.createWindow({
title: 'Select Date',
backgroundColor: '#fff'
});
win2.add(calendar);
nav.openWindow(win2);
});
var nav = Ti.UI.iOS.createNavigationWindow({
window: win
});
nav.open();
```
## License
MIT
## Author
Hans Knöchel