<p><span class="version">
Since: </span>
2.0
-</p>
+ </p>
</li>
<li class="attribute" id="Person::usageCount">
-<span class="attrName"><span class="readonly"> readonly
+<span class="attrName"><span class="readonly"> readonly
</span><span class="type">long </span><span class="name">usageCount</span></span><div class="brief">
The number of contact usage.
</div>
}
</pre>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Gets the default address book.
+ var addressbook = tizen.contact.getDefaultAddressBook();
+ var contact = null;
+
+ var name = new tizen.ContactName({
+ firstName: "Forrest",
+ lastName: "Gump"
+ });
+ var addresses = [ new tizen.ContactAddress({
+ city: "New York",
+ streetAddress: "46th St.",
+ isDefault: true }) ];
+ var phoneNumbers = [ new tizen.ContactPhoneNumber("(111) 555-1212"),
+ new tizen.ContactPhoneNumber("(111) 555-1213") ];
+
+ try {
+ contact = new tizen.Contact({
+ name: name,
+ addresses: addresses,
+ phoneNumbers: phoneNumbers
+ });
+ } catch (err) {
+ console.log( 'The following error occurred while creating contact: ' + err.name);
+ }
+
+ try {
+ if (contact) {
+ addressbook.add(contact);
+ console.log('Contact was added with ID ' + contact.id);
+ }
+ } catch (err) {
+ console.log( 'The following error occurred while adding: ' + err.name);
+ }
+ </pre>
+</div>
<div class="constructors">
<h4 id="Contact::constructor">Constructors</h4>
<dl>
</div>
<div class="constructors">
<h4 id="ContactRef::constructor">Constructors</h4>
-<dl><pre class="webidl prettyprint">ContactRef(<a href="#AddressBookId">AddressBookId</a> addressBookId, <a href="#ContactId">ContactId</a> contactId);</pre></dl>
+<dl>
+<pre class="webidl prettyprint">ContactRef(<a href="#AddressBookId">AddressBookId</a> addressBookId, <a href="#ContactId">ContactId</a> contactId);</pre>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Gets the default address book.
+ var addressbook = tizen.contact.getDefaultAddressBook();
+
+ // Creates a new contact:
+ var eve = new tizen.Contact();
+ eve.name = new tizen.ContactName({firstName:'Eve', lastName:'Green'});
+ addressbook.add(eve);
+
+ // Creates a reference to this contact:
+ var refToEve = new tizen.ContactRef(addressbook.id, eve.id);
+ </pre>
+</div>
+</dl>
</div>
<div class="attributes">
<h4>Attributes</h4>
</p>
<div class="constructors">
<h4 id="ContactName::constructor">Constructors</h4>
-<dl><pre class="webidl prettyprint">ContactName(optional <a href="#ContactNameInit">ContactNameInit</a>? nameInitDict);</pre></dl>
+<dl>
+<pre class="webidl prettyprint">ContactName(optional <a href="#ContactNameInit">ContactNameInit</a>? nameInitDict);</pre>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var myContactName = new tizen.ContactName(
+ {prefix : "Mr.", firstName : "John", lastName : "Doe"});
+ </pre>
+</div>
+</dl>
</div>
<div class="attributes">
<h4>Attributes</h4>
<div class="example">
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var name = new tizen.ContactName({ firstName: 'Anna' });
- var contact_extension1 = new tizen.ContactExtension({ data1: 20, data2: 'Place of birth: Elbląg' });
- var contact_extension2 = new tizen.ContactExtension({ data3: 'Favourite color: green' });
- var contact1 = new tizen.Contact({
- name: name,
- extensions: [ contact_extension1, contact_extension2 ]
- });
+ var contact_extension1 = new tizen.ContactExtension({ data1: 20, data2: 'Place of birth: Elbląg' });
+ var contact_extension2 = new tizen.ContactExtension({ data3: 'Favourite color: green' });
+ var contact1 = new tizen.Contact({
+ name: name,
+ extensions: [ contact_extension1, contact_extension2 ]
+ });
- console.log(contact1.extensions[1].data3); // It shows: 'Favourite color: green'
-</pre>
+ console.log(contact1.extensions[1].data3); // It shows: 'Favourite color: green'
+ </pre>
</div>
<div class="constructors">
<h4 id="ContactExtension::constructor">Constructors</h4>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(err) {
+ console.log("The following error occurred " + err.name);
+ }
+
+ function onsuccess(persons) {
+ var p;
+
+ // log each found person's name to the console:
+ for (p = 0; p < persons.length; p += 1) {
+ console.log("Name: " + persons[p].displayName);
+ }
+ }
+
+ try {
+ tizen.contact.find(onsuccess, onerror);
+ } catch (err) {
+ console.log("The following error occurred while finding: " + err.name);
+ }
+ </pre>
+</div>
</dd>
</dl>
</div>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function errorCB(err) {
+ console.log("An error occurred: " + err.name);
+ }
+
+ // A callback invoked on successful retrieval of all the Address Books.
+ function addressBooksCB(addressBooks) {
+ console.log(addressBooks.length + " address books available.");
+ }
+
+ // Gets a list of available address books.
+ tizen.contact.getAddressBooks(addressBooksCB, errorCB);
+ </pre>
+</div>
</dd>
</dl>
</div>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var watcherId = 0; // watcher identifier
+ var addressbook = tizen.contact.getDefaultAddressBook();
+
+ var watcher = {
+ oncontactsadded: function(contacts) {
+ console.log(contacts.length + " contacts were added");
+ },
+ oncontactsupdated: function(contacts) {
+ console.log(contacts.length + " contacts were updated");
+ },
+ oncontactsremoved: function(ids) {
+ console.log(ids.length + " contacts were removed");
+ }
+ };
+
+ // Registers to be notified when the address book changes.
+ watcherId = addressbook.addChangeListener(watcher);
+
+ // Adds a new contact to invoke an oncontactsadded call:
+ try {
+ var contact = new tizen.Contact({name : new tizen.ContactName({
+ firstName : 'John', lastName : 'Doe',
+ nicknames : ['Johnny']}),
+ emails : [new tizen.ContactEmailAddress('john@doe.com')],
+ phoneNumbers : [new tizen.ContactPhoneNumber('789456123')]});
+ addressbook.add(contact);
+ } catch (err) {
+ console.log('An error occurred while adding a contact: ' + err.name + ", " + err.message);
+ }
+ </pre>
+</div>
</dd>
<dt class="method" id="AddressBookChangeCallback::oncontactsupdated">
<a class="backward-compatibility-anchor" name="::Contact::AddressBookChangeCallback::oncontactsupdated"></a><code><b><span class="methodName">oncontactsupdated</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var watcherId = 0; // watcher identifier
+ var addressbook = tizen.contact.getDefaultAddressBook();
+
+ var watcher = {
+ oncontactsadded: function(contacts) {
+ console.log(contacts.length + " contacts were added");
+ },
+ oncontactsupdated: function(contacts) {
+ console.log(contacts.length + " contacts were updated");
+ },
+ oncontactsremoved: function(ids) {
+ console.log(ids.length + " contacts were removed");
+ }
+ };
+
+ // Registers to be notified when the address book changes.
+ watcherId = addressbook.addChangeListener(watcher);
+
+ // Updates a contact to invoke an oncontactsupdated call:
+ function errorCB(error) {
+ console.log(error.name + ": " + error.message);
+ }
+
+ function contactsFoundCB(contacts) {
+ contacts[0].name.firstName = 'Stanley';
+ try {
+ addressbook.update(contacts[0]);
+ console.log('Successfully updated.');
+ } catch (error) {
+ console.log(error.name + ": " + error.message);
+ }
+ }
+
+ var filter = new tizen.AttributeFilter('name.lastName', 'EXACTLY', 'Doe');
+ try {
+ addressbook.find(contactsFoundCB, errorCB, filter);
+ } catch (error) {
+ console.log(error.name + ": " + error.message);
+ }
+ </pre>
+</div>
</dd>
<dt class="method" id="AddressBookChangeCallback::oncontactsremoved">
<a class="backward-compatibility-anchor" name="::Contact::AddressBookChangeCallback::oncontactsremoved"></a><code><b><span class="methodName">oncontactsremoved</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var watcherId = 0; // watcher identifier
+ var addressbook = tizen.contact.getDefaultAddressBook();
+
+ var watcher = {
+ oncontactsadded: function(contacts) {
+ console.log(contacts.length + " contacts were added");
+ },
+ oncontactsupdated: function(contacts) {
+ console.log(contacts.length + " contacts were updated");
+ },
+ oncontactsremoved: function(ids) {
+ console.log(ids.length + " contacts were removed");
+ }
+ };
+
+ // Registers to be notified when the address book changes.
+ watcherId = addressbook.addChangeListener(watcher);
+
+ // Removes a first contact whose name is 'Doe'
+ // to invoke oncontactsremoved call:
+ function onErrorCB(err) {
+ console.log('An error occurred: ' + err.name);
+ }
+
+ function onContactsFoundCB(contacts) {
+ if(contacts.length > 0) {
+ try {
+ addressbook.remove(contacts[0].id);
+ console.log('First contact has been removed.');
+ } catch (err) {
+ console.log('An error occurred while removing: ' + err.name);
+ }
+ } else {
+ console.log('No contacts to delete.');
+ }
+ }
+
+ var filter = new tizen.AttributeFilter('name.lastName', 'EXACTLY', 'Doe');
+ try {
+ addressbook.find(onContactsFoundCB, onErrorCB, filter);
+ } catch (err) {
+ console.log('An error occured while finding: ' + err.name);
+ }
+ </pre>
+</div>
</dd>
</dl>
</div>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var watcherId = 0; // watcher identifier
+
+ var watcher = {
+ onpersonsadded: function(persons) {
+ console.log(persons.length + " persons were added");
+ },
+ onpersonsupdated: function(persons) {
+ console.log(persons.length + " persons were updated");
+ },
+ onpersonsremoved: function(ids) {
+ console.log(ids.length + " persons were deleted");
+ }
+ };
+
+ // Registers to be notified when the address book changes.
+ watcherId = tizen.contact.addChangeListener(watcher);
+ </pre>
+</div>
</dd>
<dt class="method" id="PersonsChangeCallback::onpersonsupdated">
<a class="backward-compatibility-anchor" name="::Contact::PersonsChangeCallback::onpersonsupdated"></a><code><b><span class="methodName">onpersonsupdated</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var watcherId = 0; // watcher identifier
+
+ var watcher = {
+ onpersonsadded: function(persons) {
+ console.log(persons.length + " persons were added");
+ },
+ onpersonsupdated: function(persons) {
+ console.log(persons.length + " persons were updated");
+ },
+ onpersonsremoved: function(ids) {
+ console.log(ids.length + " persons were deleted");
+ }
+ };
+
+ // Registers to be notified when the address book changes.
+ watcherId = tizen.contact.addChangeListener(watcher);
+ </pre>
+</div>
</dd>
<dt class="method" id="PersonsChangeCallback::onpersonsremoved">
<a class="backward-compatibility-anchor" name="::Contact::PersonsChangeCallback::onpersonsremoved"></a><code><b><span class="methodName">onpersonsremoved</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var watcherId = 0; // watcher identifier
+
+ var watcher = {
+ onpersonsadded: function(persons) {
+ console.log(persons.length + " persons were added");
+ },
+ onpersonsupdated: function(persons) {
+ console.log(persons.length + " persons were updated");
+ },
+ onpersonsremoved: function(ids) {
+ console.log(ids.length + " persons were deleted");
+ }
+ };
+
+ // Registers to be notified when the address book changes.
+ watcherId = tizen.contact.addChangeListener(watcher);
+ </pre>
+</div>
</dd>
</dl>
</div>
interface ContactExtension
{
attribute long data1;
-
+
attribute DOMString? data2;
-
+
attribute DOMString? data3;
-
+
attribute DOMString? data4;
-
+
attribute DOMString? data5;
-
+
attribute DOMString? data6;
-
+
attribute DOMString? data7;
-
+
attribute DOMString? data8;
-
+
attribute DOMString? data9;
-
+
attribute DOMString? data10;
-
+
attribute DOMString? data11;
-
+
attribute DOMString? data12;
};
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> console.log("The local time zone is " + tizen.time.getLocalTimezone());
</pre>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Note that it is possible to get the time zone description in other formats, e.g. by calling:
+ now = new tizen.TZDate(new Date(), 'Asia/Manila');
+
+ // Outputs "Wednesday, January 27, 2016, 8:46:00 PM GMT+0800 Philippines Time"
+ console.log(now.toString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TimeUtil::getAvailableTimezones">
<a class="backward-compatibility-anchor" name="::Time::TimeUtil::getAvailableTimezones"></a><code><b><span class="methodName">getAvailableTimezones</span></b></code>
console.log("The device supports " + tzids.length + " time zones.");
</pre>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var tzids = tizen.time.getAvailableTimezones();
+ var currentLocation = 'Europe/Berlin';
+
+ // checks whether an entry 'Europe/Berlin' exists in the array.
+ if (tzids.indexOf(currentLocation) > -1) {
+ console.log('The device supports ' + currentLocation + ' timezone.');
+ } else {
+ console.log('The device does not support ' + currentLocation + ' timezone.');
+ }
+ </pre>
+</div>
</dd>
<dt class="method" id="TimeUtil::getDateFormat">
<a class="backward-compatibility-anchor" name="::Time::TimeUtil::getDateFormat"></a><code><b><span class="methodName">getDateFormat</span></b></code>
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Gets the long date format, e.g. "D, M d y".
+ var dateFormat = tizen.time.getDateFormat();
+
+ // Gets the short date format, e.g. "d/m/y".
+ var shortDateFormat = tizen.time.getDateFormat(true);
+
+ console.log("Long date format: " + dateFormat);
+ </pre>
+</div>
</dd>
<dt class="method" id="TimeUtil::getTimeFormat">
<a class="backward-compatibility-anchor" name="::Time::TimeUtil::getTimeFormat"></a><code><b><span class="methodName">getTimeFormat</span></b></code>
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Gets the time format, e.g. "h:m:s ap".
+ var timeFormat = tizen.time.getTimeFormat();
+
+ console.log(timeFormat);
+ </pre>
+</div>
</dd>
<dt class="method" id="TimeUtil::isLeapYear">
<a class="backward-compatibility-anchor" name="::Time::TimeUtil::isLeapYear"></a><code><b><span class="methodName">isLeapYear</span></b></code>
If its date/time exceeds the platform limit, TZDate will be invalid.
</div>
<pre class="webidl prettyprint"> [Constructor(optional Date? datetime, optional DOMString? timezone),
+
Constructor(long year, long month, long day, optional long? hours, optional long? minutes, optional long? seconds, optional long? milliseconds, optional DOMString? timezone)]
interface TZDate {
<b>year</b> : The year of TZDate. If it is between 0 and 99, 1900 will be added to it like Javascript Date object. </li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Creates a new TZDate object with current date/time and timezone:
+ var now = new tizen.TZDate();
+
+ // Creates a new TZDate object with date set to 1st of January 2016 in time zone for Germany:
+ var newYear = new tizen.TZDate(new Date("2016-01-01"), 'Europe/Berlin');
+
+ // Creates a new TZDate object with values set explicitly:
+ var myDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/Berlin');
+ </pre>
+</div>
</dl>
</div>
<div class="methods">
<p><span class="return">Return value:</span></p>
long The day of the month.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getDate()); // should output 31.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setDate">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setDate"></a><code><b><span class="methodName">setDate</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setDate(1); // Changes the day of month to 1.
+ console.log(someDate.getDate()); // should output 1.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getDay">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getDay"></a><code><b><span class="methodName">getDay</span></b></code>
</dt>
<dd>
<div class="brief">
- Gets the day of the week (from 0-6).
+ Gets the day of the week (from 0-6). 0 denotes Sunday, 1 denotes Monday and so on.
</div>
<div class="synopsis"><pre class="signature prettyprint">long getDay();
</pre></div>
<p><span class="return">Return value:</span></p>
long The day of the week
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getDay()); // should output "5", because 31st of December 1999 was friday.
+
+</pre>
+</div>
</dd>
<dt class="method" id="TZDate::getFullYear">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getFullYear"></a><code><b><span class="methodName">getFullYear</span></b></code>
<p><span class="return">Return value:</span></p>
long The year
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getFullYear()); // should output 1999.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setFullYear">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setFullYear"></a><code><b><span class="methodName">setFullYear</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setFullYear(2099); // Changes the year to 2099.
+ console.log(someDate.getFullYear()); // should output 2099.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getHours">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getHours"></a><code><b><span class="methodName">getHours</span></b></code>
<p><span class="return">Return value:</span></p>
long The hour
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getHours()); // should output 23.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setHours">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setHours"></a><code><b><span class="methodName">setHours</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setHours(15); // Sets the hour to 3 PM.
+ console.log(someDate.getHours()); // should output 15.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getMilliseconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getMilliseconds"></a><code><b><span class="methodName">getMilliseconds</span></b></code>
<p><span class="return">Return value:</span></p>
long The milliseconds
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getMilliseconds()); // should output 999.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setMilliseconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setMilliseconds"></a><code><b><span class="methodName">setMilliseconds</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setMilliseconds(42);
+ console.log(someDate.getMilliseconds()); // should output 42.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getMinutes">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getMinutes"></a><code><b><span class="methodName">getMinutes</span></b></code>
<p><span class="return">Return value:</span></p>
long The minutes
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getMinutes()); // should output 59.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setMinutes">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setMinutes"></a><code><b><span class="methodName">setMinutes</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setMinutes(58);
+ console.log(someDate.getMinutes()); // should output 58.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getMonth">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getMonth"></a><code><b><span class="methodName">getMonth</span></b></code>
</dt>
<dd>
<div class="brief">
- Gets the month (from 0-11).
+ Gets the month (from 0-11). <br />Note: January is denoted as 0, February as 1, and so on till December, which is denoted as 11.
</div>
<div class="synopsis"><pre class="signature prettyprint">long getMonth();
</pre></div>
<p><span class="return">Return value:</span></p>
long The month
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getMonth()); // should output 11.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setMonth">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setMonth"></a><code><b><span class="methodName">setMonth</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setMonth(2); // Changes the month to March.
+ console.log(someDate.getMonth()); // should output 2.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getSeconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getSeconds"></a><code><b><span class="methodName">getSeconds</span></b></code>
<p><span class="return">Return value:</span></p>
long The seconds
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getSeconds()); // should output 59.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setSeconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setSeconds"></a><code><b><span class="methodName">setSeconds</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setSeconds(23);
+ console.log(someDate.getSeconds()); // should output 23.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCDate">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCDate"></a><code><b><span class="methodName">getUTCDate</span></b></code>
<p><span class="return">Return value:</span></p>
long The day of the month, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCDate()); // should output 31.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCDate">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCDate"></a><code><b><span class="methodName">setUTCDate</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCDate(5) // Change the day of month to 5th.
+ console.log(someDate.getUTCDate()); // should output 5.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCDay">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCDay"></a><code><b><span class="methodName">getUTCDay</span></b></code>
<p><span class="return">Return value:</span></p>
long The day of the week, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCDay()); // should output 5, since 31st of December 1999 was friday.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCFullYear">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCFullYear"></a><code><b><span class="methodName">getUTCFullYear</span></b></code>
<p><span class="return">Return value:</span></p>
long The year, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCFullYear()); // should output 1999.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCFullYear">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCFullYear"></a><code><b><span class="methodName">setUTCFullYear</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCFullYear(2099); // Change the year to 2099, universal time.
+ console.log(someDate.getUTCFullYear()); // should output 2099.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCHours">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCHours"></a><code><b><span class="methodName">getUTCHours</span></b></code>
<p><span class="return">Return value:</span></p>
long The hour, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCHours()); // should output 23.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCHours">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCHours"></a><code><b><span class="methodName">setUTCHours</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCHours(15);
+ console.log(someDate.getUTCHours()); // should output 15.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCMilliseconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCMilliseconds"></a><code><b><span class="methodName">getUTCMilliseconds</span></b></code>
<p><span class="return">Return value:</span></p>
long The milliseconds, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCMilliseconds()); // should output 999.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCMilliseconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCMilliseconds"></a><code><b><span class="methodName">setUTCMilliseconds</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCMillisecond(42);
+ console.log(someDate.getUTCMilliseconds()); // should output 42.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCMinutes">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCMinutes"></a><code><b><span class="methodName">getUTCMinutes</span></b></code>
<p><span class="return">Return value:</span></p>
long The minutes, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCMinutes()); // should output 59.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCMinutes">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCMinutes"></a><code><b><span class="methodName">setUTCMinutes</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCMinutes(58);
+ console.log(someDate.getUTCMinutes()); // should output 58.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCMonth">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCMonth"></a><code><b><span class="methodName">getUTCMonth</span></b></code>
</dt>
<dd>
<div class="brief">
- Gets the month, according to universal time (from 0-11).
+ Gets the month, according to universal time (from 0-11). <br />Note: January is denoted as 0, February as 1 and so on till December, which is denoted as 11.
</div>
<div class="synopsis"><pre class="signature prettyprint">long getUTCMonth();
</pre></div>
<p><span class="return">Return value:</span></p>
long The month, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCMonth()); // should output 11.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCMonth">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCMonth"></a><code><b><span class="methodName">setUTCMonth</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCMonth(2); // Sets the month to March, according to the universal time.
+ console.log(someDate.getUTCMonth()); // should output 2.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getUTCSeconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getUTCSeconds"></a><code><b><span class="methodName">getUTCSeconds</span></b></code>
<p><span class="return">Return value:</span></p>
long The seconds, according to universal time
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getUTCSeconds()); // should output 59.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::setUTCSeconds">
<a class="backward-compatibility-anchor" name="::Time::TZDate::setUTCSeconds"></a><code><b><span class="methodName">setUTCSeconds</span></b></code>
</li>
</ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ someDate.setUTCSeconds(23);
+ console.log(someDate.getUTCSeconds()); // should output 23.
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getTimezone">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getTimezone"></a><code><b><span class="methodName">getTimezone</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The string timezone identifier <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ console.log(someDate.getTimezone()); // should output "Europe/London".
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toTimezone">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toTimezone"></a><code><b><span class="methodName">toTimezone</span></b></code>
</ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ var koreanDate = someDate.toTimezone("Asia/Seoul");
+
+ // Should output: "Saturday, January 1, 2000, 8:59:59 AM GMT+0900 South Korea Time"
+ console.log(someDate.toString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toLocalTimezone">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toLocalTimezone"></a><code><b><span class="methodName">toLocalTimezone</span></b></code>
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // This example assumes that the device's local time zone is set to Asia/Seoul.
+ // You may get different results depending on your local time zone settings.
+ var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Europe/London");
+ var localDate = someDate.toLocalTimezone();
+
+ // Should output: "Saturday, January 1, 2000, 8:59:59 AM GMT+0900 South Korea Time"
+ console.log(localDate.toString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toUTC">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toUTC"></a><code><b><span class="methodName">toUTC</span></b></code>
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, "Asia/Seoul");
+ var utcDate = someDate.toUTC();
+
+ // Should output: "Friday, December 31, 1999, 2:59:59 PM GMT+0000 GMT"
+ console.log(utcDate.toString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::difference">
<a class="backward-compatibility-anchor" name="::Time::TZDate::difference"></a><code><b><span class="methodName">difference</span></b></code>
</ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Prepares two TZDates pointing at new year eves in 2011 and 2012, respectively:
+ var newYearEve2011 = new tizen.TZDate(2011, 0, 0, 0, 0, 0, 0, "Europe/London");
+ var newYearEve2012 = new tizen.TZDate(2012, 0, 0, 0, 0, 0, 0, "Europe/London");
+
+ // Calculates how much is the difference between those two dates:
+ var difference = newYearEve2012.difference(newYearEve2011);
+
+ // Should output: "The difference is 365 DAYS" (since none of those dates have time component)
+ console.log("The difference is " + difference.length + " " + difference.unit);
+ </pre>
+</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Prepares two TZDates pointing at 6:00 PM and 8:00 PM on the same day:
+ var joggingStart = new tizen.TZDate(2015, 6, 6, 18, 0, 0, 0, "Europe/London");
+ var joggingEnd = new tizen.TZDate(2015, 6, 6, 20, 0, 0, 0, "Europe/London");
+
+ // Calculates how much is the difference between those two dates:
+ var difference = joggingEnd.difference(joggingStart);
+
+ // Should output: "The difference is 7200000 MSECS" (since both of those dates do have time component)
+ console.log("The difference is " + difference.length + " " + difference.unit);
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::equalsTo">
<a class="backward-compatibility-anchor" name="::Time::TZDate::equalsTo"></a><code><b><span class="methodName">equalsTo</span></b></code>
</ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var noonInEngland = new tizen.TZDate(2016, 0, 27, 12, 0, 0, 0, 'Europe/London');
+ var sameTimeInKorea = noonInEngland.toTimezone('Asia/Seoul');
+ var isTheSame = noonInEngland.equalsTo(sameTimeInKorea);
+
+ // Those are the same dates (in different time zones), so the output should be "Those dates are equal."
+ if(isTheSame) {
+ console.log("Those dates are equal.");
+ } else {
+ console.log("Those dates are not equal.");
+ }
+ </pre>
+</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var noonInEngland = new tizen.TZDate(2016, 0, 27, 12, 0, 0, 0, 'Europe/London');
+ var noonInKorea = new tizen.TZDate(2016, 0, 27, 12, 0, 0, 0, 'Asia/Seoul');
+ var isTheSame = noonInEngland.equalsTo(noonInKorea);
+
+ // Those are not the same dates (obviously, noon in London is not noon in Seoul),
+ // so the output should be "Those dates are not equal."
+ if(isTheSame) {
+ console.log("Those dates are equal.");
+ } else {
+ console.log("Those dates are not equal.");
+ }
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::earlierThan">
<a class="backward-compatibility-anchor" name="::Time::TZDate::earlierThan"></a><code><b><span class="methodName">earlierThan</span></b></code>
</ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Create a new TZDate object pointing to noon in London:
+ var tzd1 = new tizen.TZDate(2016, 0, 1, 12, 0, 0, 0, 'Europe/London');
+
+ // Create a new TZDate object pointing to 6 PM in Seoul on the same day:
+ var tzd2 = new tizen.TZDate(2016, 0, 1, 18, 0, 0, 0, 'Asia/Seoul');
+
+ // is 12:00 local time in London earlier than 18:00 local time in Seoul?
+ var isEarlier = tzd1.earlierThan(tzd2);
+
+ // should output 'false', since local time in Seoul is GMT (London) + 9 hours.
+ console.log(isEarlier);
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::laterThan">
<a class="backward-compatibility-anchor" name="::Time::TZDate::laterThan"></a><code><b><span class="methodName">laterThan</span></b></code>
</ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Create a new TZDate object pointing to noon in London:
+ var tzd1 = new tizen.TZDate(2016, 0, 1, 12, 0, 0, 0, 'Europe/London');
+
+ // Create a new TZDate object pointing to 6 PM in Seoul on the same day:
+ var tzd2 = new tizen.TZDate(2016, 0, 1, 18, 0, 0, 0, 'Asia/Seoul');
+
+ // is 12:00 local time in London earlier than 18:00 local time in Seoul?
+ var isLater = tzd1.laterThan(tzd2);
+
+ // should output 'true', since local time in Seoul is GMT (London) + 9 hours.
+ console.log(isLater);
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::addDuration">
<a class="backward-compatibility-anchor" name="::Time::TZDate::addDuration"></a><code><b><span class="methodName">addDuration</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The date portion of the TZDate object as a string, using locale conventions <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/London');
+
+ // Output example (depends on locale settings): "Friday, December 31, 1999"
+ console.log(someDate.toLocaleDateString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toLocaleTimeString">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toLocaleTimeString"></a><code><b><span class="methodName">toLocaleTimeString</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The time portion of the TZDate object as a string, using locale conventions <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/London');
+
+ // Output example (depends on locale settings): "11:59:59 PM"
+ console.log(someDate.toLocaleTimeString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toLocaleString">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toLocaleString"></a><code><b><span class="methodName">toLocaleString</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The string representation of the TZDate object, using locale conventions <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/London');
+
+ // Output example (depends on locale settings): "Friday, December 31, 1999, 11:59:59 PM"
+ console.log(someDate.toLocaleString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toDateString">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toDateString"></a><code><b><span class="methodName">toDateString</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The date portion of the TZDate object as a string <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/London');
+
+ // Should output: "Friday, December 31, 1999"
+ console.log(someDate.toDateString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toTimeString">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toTimeString"></a><code><b><span class="methodName">toTimeString</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The time portion of the TZDate object as a string <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/London');
+
+ // Should output: "11:59:59 PM GMT+0000 United Kingdom Time"
+ console.log(someDate.toTimeString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::toString">
<a class="backward-compatibility-anchor" name="::Time::TZDate::toString"></a><code><b><span class="methodName">toString</span></b></code>
<p><span class="return">Return value:</span></p>
DOMString The string representation of the TZDate object <br>If TZDate is invalid, it will return 'Invalid Date'.
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var someDate = new tizen.TZDate(1999, 11, 31, 23, 59, 59, 999, 'Europe/London');
+
+ // Should output: "Friday, December 31, 1999, 11:59:59 PM GMT+0000 United Kingdom Time"
+ console.log(someDate.toString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getTimezoneAbbreviation">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getTimezoneAbbreviation"></a><code><b><span class="methodName">getTimezoneAbbreviation</span></b></code>
<div class="brief">
Determines the time zone abbreviation to be used at a particular date in the time zone.
</div>
-<div class="deprecated"><p><font color="red"><i><b>Deprecated.</b>
+<p class="deprecated"><b>Deprecated.</b>
Deprecated since 2.1.
- </i></font></p></div>
+ </p>
<div class="synopsis"><pre class="signature prettyprint">DOMString getTimezoneAbbreviation();
</pre></div>
<p><span class="version">
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var summertime = new tizen.TZDate(2015, 6, 1, 10, 0, 0, 0, 'Europe/London');
+ var wintertime = new tizen.TZDate(2015, 0, 1, 10, 0, 0, 0, 'Europe/London');
+
+ var isDstActiveInSummer = summertime.isDST(); // true
+ var isDstActiveInWinter = wintertime.isDST(); // false
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getPreviousDSTTransition">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getPreviousDSTTransition"></a><code><b><span class="methodName">getPreviousDSTTransition</span></b></code>
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Creates the TZDate object pointing to January 2016.
+ var winter16 = new tizen.TZDate(2016, 0, 1, 10, 0, 0, 0, 'Europe/London');
+
+ // Gets the date of previous DST transition:
+ var previousDstTransition = winter16.getPreviousDSTTransition();
+
+ // Should output: "Sunday, October 25, 2015, 1:00:00 AM GMT+0000 United Kingdom Time"
+ console.log(previousDstTransition.toString());
+ </pre>
+</div>
</dd>
<dt class="method" id="TZDate::getNextDSTTransition">
<a class="backward-compatibility-anchor" name="::Time::TZDate::getNextDSTTransition"></a><code><b><span class="methodName">getNextDSTTransition</span></b></code>
</p></li></ul>
</li></ul>
</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Creates the TZDate object pointing to January 2016.
+ var winter16 = new tizen.TZDate(2016, 0, 1, 10, 0, 0, 0, 'Europe/London');
+
+ // Gets the date of next DST transition:
+ var nextDstTransition = winter16.getNextDSTTransition();
+
+ // Should output: "Sunday, March 27, 2016, 2:00:00 AM GMT+0100 United Kingdom Time"
+ console.log(nextDstTransition.toString());
+ </pre>
+</div>
</dd>
</dl>
</div>
The TimeDuration interface that contains the length and its associated time unit.
</div>
<pre class="webidl prettyprint"> [Constructor(long long length, optional <a href="#TimeDurationUnit">TimeDurationUnit</a>? unit)]
+
interface TimeDuration
{
attribute long long length;
attribute <a href="#TimeDurationUnit">TimeDurationUnit</a> unit;
+
<a href="#TimeDuration">TimeDuration</a> difference(<a href="#TimeDuration">TimeDuration</a> other) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
boolean equalsTo(<a href="#TimeDuration">TimeDuration</a> other) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
Since: </span>
1.0
</p>
+<div class="constructors">
+<h4 id="TimeDuration::constructor">Constructors</h4>
+<dl>
+<div class="brief">
+ The TimeDuration interface that contains the length and its associated time unit.
+ </div>
+<pre class="webidl prettyprint">TimeDuration(long long length, optional <a href="#TimeDurationUnit">TimeDurationUnit</a>? unit);</pre>
<div class="example">
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var now = tizen.time.getCurrentDateTime();
var tomorrow = now.addDuration(new tizen.TimeDuration(1, "DAYS")); // Becomes tomorrow, same time.
</pre>
</div>
-<div class="constructors">
-<h4 id="TimeDuration::constructor">Constructors</h4>
-<dl><pre class="webidl prettyprint">TimeDuration(long long length, optional <a href="#TimeDurationUnit">TimeDurationUnit</a>? unit);</pre></dl>
+</dl>
</div>
<div class="attributes">
<h4>Attributes</h4>
Since: </span>
1.0
</p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
+ // Changing both length and unit of existing TimeDuration objects is possible:
+
+ var now = tizen.time.getCurrentDateTime();
+ var threeHours = new tizen.TimeDuration();
+ threeHours.length = 3;
+ threeHours.unit = "HOURS";
+ var later = now.addDuration(threeHours); // later points to a time three hours from now.
+ </pre>
+</div>
</li>
</ul>
</div>
};
[Constructor(optional Date? datetime, optional DOMString? timezone),
+
Constructor(long year, long month, long day, optional long? hours, optional long? minutes, optional long? seconds, optional long? milliseconds, optional DOMString? timezone)]
interface TZDate {
};
[Constructor(long long length, optional <a href="#TimeDurationUnit">TimeDurationUnit</a>? unit)]
+
interface TimeDuration
{
attribute long long length;
attribute <a href="#TimeDurationUnit">TimeDurationUnit</a> unit;
+
<a href="#TimeDuration">TimeDuration</a> difference(<a href="#TimeDuration">TimeDuration</a> other) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
boolean equalsTo(<a href="#TimeDuration">TimeDuration</a> other) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);