Confirmed users
110
edits
(→Goals) |
|||
Line 43: | Line 43: | ||
}; | }; | ||
* 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 | * 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 to carry more details about that alarm. A unique ID will be returned to specify the added alarm. | ||
* We can use <code>navigator.remove(...)</code> to remove an alarm that has been added in the | * We can use <code>navigator.remove(...)</code> to remove an alarm that has been added in the system with a unique ID. | ||
* We can use <code>navigator.getAll()</code> to retrieve the information of each alarm that has been added in the | * We can use <code>navigator.getAll()</code> to retrieve the information of each alarm that has been added in the system, including the unique ID, the customized JSON object data and the setting time (respects to the timezone or not)... etc. | ||
== Examples == | == Examples == |