Skip to content

Instantly share code, notes, and snippets.

@lcruz
Created September 20, 2012 13:13
Show Gist options
  • Save lcruz/3755821 to your computer and use it in GitHub Desktop.
Save lcruz/3755821 to your computer and use it in GitHub Desktop.
Agregar un evento via Titanium (Solo IOS)
/**
* Ejemplo del modulo Ttiatium-Calenadar disponible en:
*
* https://github.com/stelford/Titanium-Calendar
*/
var btnAgendarCal = Titanium.UI.createButton({
backgroundImage: '/images/btnAgendarCal.png',
left: 10,
width: 144,
height: 30,
});
btnAgendarCal.addEventListener('click', function() {
var ticalendar = require("com.ti.calendar");
var ev = ticalendar.createItem({title:"Evento creado por titanium", startDate: new Date()});
var p = ev.saveEvent();
if (p.error === 'none') {
alert('Evento creado con exito!');
} else {
alert('No se ha podido crear el evento.');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment