Confirmed users
110
edits
m (→Examples) |
(→Proposed API: add some descriptions to introduce how to use the navigator.add()) |
||
Line 32: | Line 32: | ||
== Proposed API == | == Proposed API == | ||
There is an object in <code>window.navigator</code> named <code>mozAlarms</code> with the following interface | There is an object in <code>window.navigator</code> named <code>mozAlarms</code> with the following interface: | ||
interface AlarmsManager | interface AlarmsManager | ||
Line 40: | Line 40: | ||
void remove(in unsigned long id); | void remove(in unsigned long id); | ||
}; | }; | ||
Regarding the <code>navigator.add(...)</code>, the first argument <code>date</code> can be passed by a ''Date'' object and the second argument <code>respectTimezone</code> can be passed by either <code>"honorTimezone"</code> or <code>"ignoreTimezone"</code> to specify if we need to ignore the timezone information of that ''Date'' object. When <code>"honorTimezone"</code> is passed, we will alert that application when that time happens in that timezone. I.e. if someone passes a ''Date'' object which has the timezone set to US Pacific Time and time set to 7am, we will alert the application when the time is 7am in the US Pacific timezone, even if the user is in New York and thus in US Eastern Time and it's 10am for the user. When <code>"ignoreTimezone"</code> is passed, we will ignore the timezone part of the passed in ''Date'' object. I.e. if someone passes a ''Date'' object which has the timezone set to US Pacific Time and time set to 7am, we will alert the application when the time is 7am in whatever timezone the user happens to be in. So if the user is in New York, we will alert the user when it's 7am in that timezone. Finally, the third argument <code>data</code> can be optionally specified to pass the customized JSON object data for that alarm. | |||
== Examples == | == Examples == |