2012-07-17 6 views
4

내 캘린더에서 일정을 설정할 수 있습니다. 내 코드는일정에 알람을 설정하는 방법

var ev = new tizen.CalendarEvent 
    ({ 
     description : document.getElementById('des').value, 
     summary : document.getElementById('summ').value, 
     startDate : new tizen.TZDate(yy, mm, dd, h, m), 
     duration : new tizen.TimeDuration(dur1, "HOURS"), 
     location : document.getElementById('loc').value, 
    }); 

어떻게 설정할 수 있습니까? 즉 이벤트에 대한 알람을 활성화하려고합니다. 아무도 모른다면 코드를 제공하십시오.

미리 감사드립니다.

답변

5

마지막으로 내가

calendar = tizen.calendar.getDefaultCalendar("EVENT"); 
var ev = new tizen.CalendarEvent({ 
description : document.getElementById('description1').value, 
summary : document.getElementById('Summary1').value, 
startDate : new tizen.TZDate(yy, mm, dd, h, m), 
duration : new tizen.TimeDuration(dur1, "HOURS"), 
location : document.getElementById('Location1').value, 
var alarm = new tizen.CalendarAlarm(new tizen.TimeDuration(1, "MINS"), "SOUND"); 
ev.alarms = [alarm]; 
calendar.add(ev); 
0

나는 Tizen phone에 시험이 코드 답을 얻고 그것을 작동합니다 : 당신의 대답에

var mycalendar; 
    try{   
     mycalendar = tizen.calendar.getDefaultCalendar("EVENT"); 
     var calendarItem = new tizen.CalendarEvent(); 

     calendarItem.description = "Description"; 
     calendarItem.summary = "Summary"; 
     calendarItem.location = "StackOverflow"; 
     calendarItem.startDate = new tizen.TZDate(2012, 8, 7, hour, minute); 
     calendarItem.duration = new tizen.TimeDuration(duration, "MINS"); 

     mycalendar.add(calendarItem); 

    } 
    catch(add_exception){ 
     alert("Exceptie adauga : " + add_exception.message); 
    } 

코드는 CalendarEvent({의 폐쇄하지 않은 오류가 괄호와 괄호가 있으며 쉼표는 location 줄 끝 부분에 있습니다.