Reinforced modules with example methods call.
authorAdam Szczerbiak <a.szczerbiak@samsung.com>
Thu, 28 Jan 2016 11:41:53 +0000 (12:41 +0100)
committerHyunJin Park <hj.na.park@samsung.com>
Tue, 2 Feb 2016 10:34:19 +0000 (19:34 +0900)
Change-Id: Ice7475268425dde1aa0e45c23205a5cb9aea9aaa
Signed-off-by: Adam Szczerbiak <a.szczerbiak@samsung.com>
org.tizen.web.apireference/html/device_api/mobile/tizen/badge.html
org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html
org.tizen.web.apireference/html/device_api/mobile/tizen/time.html
org.tizen.web.apireference/html/device_api/mobile/tizen/tizen.html

index 6c4324a..82766d9 100644 (file)
@@ -114,6 +114,10 @@ There is a tizen.badge object that allows accessing the functionality of the Bad
             Since: </span>
  2.3
             </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">   console.log("Maximum length of a badge number is " + tizen.badge.maxBadgeCount);
+ </pre>
+</div>
 </li></ul>
 </div>
 <div class="methods">
@@ -284,14 +288,18 @@ There is a tizen.badge object that allows accessing the functionality of the Bad
 </li></ul>
         </div>
 <div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">  function watcher(appId, count) {
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">  // Let's assume that at least two applications are installed
+
+  function onListInstalledApps(appsInfo) {
+    function watcher(appId, count) {
       console.log(appId + ' badge number were updated : ' + count);
+    }
+
+    // Registers to be notified when the badge number changes
+    tizen.badge.addChangeListener([appsInfo[0].id, [appsInfo[1].id], watcher);
   }
 
-  // Registers to be notified when the badge number changes
-  // Let's assume that applications "AVbg1ZHu6l.BadgeSample" and "BDb5tZJe47.TestSample"
-  // are installed
-  tizen.badge.addChangeListener(["AVbg1ZHu6l.BadgeSample", "BDb5tZJe47.TestSample"], watcher);
+  tizen.application.getAppsInfo(onListInstalledApps);
  </pre>
 </div>
 </dd>
@@ -341,18 +349,21 @@ There is a tizen.badge object that allows accessing the functionality of the Bad
 </li></ul>
         </div>
 <div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">  // Receives badge number changes
-  function watcher(appId, count) {
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">  // Let's assume that at least two applications are installed
+
+  function onListInstalledApps(appsInfo) {
+    function watcher(appId, count) {
       console.log(appId + ' badge number were updated : ' + count);
-  }
+    }
 
-  // Registers to be notified when the badge number changes
-  // Let's assume that applications "AVbg1ZHu6l.BadgeSample" and "BDb5tZJe47.TestSample"
-  // are installed
-  tizen.badge.addChangeListener(["AVbg1ZHu6l.BadgeSample", "BDb5tZJe47.TestSample"], watcher);
+    // Registers to be notified when the badge number changes
+    tizen.badge.addChangeListener([appsInfo[0].id, [appsInfo[1].id], watcher);
 
-  // Cancels the watch operation
-  tizen.badge.removeChangeListener(["AVbg1ZHu6l.BadgeSample", "BDb5tZJe47.TestSample"]);
+    // Cancels the watch operation
+    tizen.badge.removeChangeListener([appsInfo[0].id, [appsInfo[1].id]);
+  }
+
+  tizen.application.getAppsInfo(onListInstalledApps);
  </pre>
 </div>
 </dd>
@@ -401,6 +412,23 @@ There is a tizen.badge object that allows accessing the functionality of the Bad
                 </li>
         </ul>
 </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">   // logs the number of badge changes:
+   function watcher(appId, count) {
+     console.log(appId + ' -&gt; badge number updates: ' + count);
+   }
+
+   // gets Application's ID:
+   var appId = tizen.application.getCurrentApplication().appInfo.id;
+
+   // let's assume that the application "TestSample.main" has been installed.
+   var targetAppId = "TestSample.main";
+
+   // registers to be notified when the badge number changes for either
+   // this or targetAppId application:
+   tizen.badge.addChangeListener([appId, targetAppId], watcher);
+ </pre>
+</div>
 </dd>
 </dl>
 </div>
index 4d13efb..45394b6 100644 (file)
@@ -3455,10 +3455,10 @@ The contact, this value is indicating, is used to show detailed information of t
 <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>
@@ -3795,6 +3795,42 @@ This dictionary is used to input parameters when contacts are created.
   }
  </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>
@@ -4402,7 +4438,22 @@ This interface is used by other APIs to uniquely and globally identify contacts.
          </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>
@@ -4487,7 +4538,14 @@ See the ContactName interface for more information about the members.
           </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>
@@ -5837,15 +5895,15 @@ See code example below.
 <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>
@@ -6010,6 +6068,27 @@ get or save a list of persons.
                 </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 &lt; 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>
@@ -6108,6 +6187,20 @@ get address books.
                 </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>
@@ -6160,6 +6253,38 @@ book change occurs (contact addition/update/deletion).
                 </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>
@@ -6183,6 +6308,48 @@ book change occurs (contact addition/update/deletion).
                 </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>
@@ -6206,6 +6373,52 @@ book change occurs (contact addition/update/deletion).
                 </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 &gt; 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>
@@ -6257,6 +6470,25 @@ list change occurs (person addition/update/deletion).
                 </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>
@@ -6280,6 +6512,25 @@ list change occurs (person addition/update/deletion).
                 </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>
@@ -6303,6 +6554,25 @@ list change occurs (person addition/update/deletion).
                 </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>
@@ -6716,27 +6986,27 @@ list change occurs (person addition/update/deletion).
   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;
   };
 
index 3750c3b..0001eb1 100644 (file)
@@ -306,6 +306,14 @@ Get timezones using getLocalTimezone() and getAvailableTimezones().            <
 <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>
@@ -343,6 +351,18 @@ with the most general descriptor first and the most specific one last. For examp
  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) &gt; -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>
@@ -398,6 +418,16 @@ date format (23/10/2011) instead of a long date format ("Monday, October 23 2011
                 </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>
@@ -441,6 +471,13 @@ Examples of string formats include: "h:m:s ap", "h:m:s".
                 </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>
@@ -686,6 +723,7 @@ date/time in a predefined timezone.
 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 {
@@ -804,6 +842,17 @@ If its date/time exceeds the platform limit, TZDate will be invalid.
 <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">
@@ -826,6 +875,11 @@ If its date/time exceeds the platform limit, TZDate will be invalid.
 <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>
@@ -855,13 +909,19 @@ For example, if TZDate's month is May and parameter is 32, it will be set to Jun
                 </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>
@@ -873,6 +933,12 @@ For example, if TZDate's month is May and parameter is 32, it will be set to Jun
 <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>
@@ -897,6 +963,11 @@ For example, 1 = AD 1, 0 = BC 1, -1 = BC 2.
 <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>
@@ -920,6 +991,12 @@ For example, 1 = AD 1, 0 = BC 1, -1 = BC 2.
                 </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>
@@ -938,6 +1015,11 @@ For example, 1 = AD 1, 0 = BC 1, -1 = BC 2.
 <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>
@@ -967,6 +1049,12 @@ For example, calling setHours(24) results in setting hour to 00:00 and date to t
                 </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>
@@ -985,6 +1073,11 @@ For example, calling setHours(24) results in setting hour to 00:00 and date to t
 <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>
@@ -1014,6 +1107,12 @@ For example, calling setMilliseconds(1000) results in setting milliseconds to 0
                 </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>
@@ -1032,6 +1131,11 @@ For example, calling setMilliseconds(1000) results in setting milliseconds to 0
 <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>
@@ -1062,13 +1166,19 @@ For example, calling setMinutes(60) results in setting minutes to 0 and adding o
                 </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>
@@ -1080,6 +1190,11 @@ For example, calling setMinutes(60) results in setting minutes to 0 and adding o
 <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>
@@ -1109,6 +1224,12 @@ For example, calling setMonth(12) results in setting month to 0 and adding one y
                 </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>
@@ -1127,6 +1248,11 @@ For example, calling setMonth(12) results in setting month to 0 and adding one y
 <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>
@@ -1156,6 +1282,12 @@ For example, calling setSeconds(60) results in setting seconds to 0 and adding o
                 </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>
@@ -1174,6 +1306,11 @@ For example, calling setSeconds(60) results in setting seconds to 0 and adding o
 <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>
@@ -1203,6 +1340,12 @@ For example, calling setUTCDate(32) when TZDate's month is May results in settin
                 </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>
@@ -1221,6 +1364,11 @@ For example, calling setUTCDate(32) when TZDate's month is May results in settin
 <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>
@@ -1245,6 +1393,11 @@ For example, 1 = AD 1, 0 = BC 1, -1 = BC 2.
 <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>
@@ -1268,6 +1421,12 @@ For example, 1 = AD 1, 0 = BC 1, -1 = BC 2.
                 </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>
@@ -1286,6 +1445,11 @@ For example, 1 = AD 1, 0 = BC 1, -1 = BC 2.
 <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>
@@ -1315,6 +1479,12 @@ For example, calling setUTCHours(24) results in setting hour to 0 and adding one
                 </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>
@@ -1333,6 +1503,11 @@ For example, calling setUTCHours(24) results in setting hour to 0 and adding one
 <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>
@@ -1362,6 +1537,12 @@ For example, calling setUTCMilliseconds(1000) results in setting milliseconds to
                 </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>
@@ -1380,6 +1561,11 @@ For example, calling setUTCMilliseconds(1000) results in setting milliseconds to
 <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>
@@ -1409,13 +1595,19 @@ For example, calling setUTCMinutes(60) results in setting minutes to 0 and addin
                 </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>
@@ -1427,6 +1619,11 @@ For example, calling setUTCMinutes(60) results in setting minutes to 0 and addin
 <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>
@@ -1456,6 +1653,12 @@ For example, calling setUTCMonth(12) results in setting month to 0 and adding on
                 </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>
@@ -1474,6 +1677,11 @@ For example, calling setUTCMonth(12) results in setting month to 0 and adding on
 <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>
@@ -1503,6 +1711,12 @@ For example, calling setUTCSeconds(60) results in setting seconds to 0 and addin
                 </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>
@@ -1531,6 +1745,11 @@ This attribute uniquely identifies the timezone.
 <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>
@@ -1575,6 +1794,14 @@ is not recognized as a valid timezone identifier.
 </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>
@@ -1600,6 +1827,16 @@ is not recognized as a valid timezone identifier.
                 </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>
@@ -1625,6 +1862,14 @@ is not recognized as a valid timezone identifier.
                 </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>
@@ -1685,6 +1930,30 @@ is not compatible with the expected type for that parameter.
 </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>
@@ -1730,6 +1999,33 @@ is not compatible with the expected type for that parameter.
 </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>
@@ -1775,6 +2071,20 @@ is not compatible with the expected type for that parameter.
 </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>
@@ -1820,6 +2130,20 @@ is not compatible with the expected type for that parameter.
 </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>
@@ -1892,6 +2216,13 @@ is not compatible with the expected type for that parameter.
 <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>
@@ -1910,6 +2241,13 @@ is not compatible with the expected type for that parameter.
 <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>
@@ -1928,6 +2266,13 @@ is not compatible with the expected type for that parameter.
 <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>
@@ -1946,6 +2291,13 @@ is not compatible with the expected type for that parameter.
 <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>
@@ -1964,6 +2316,13 @@ is not compatible with the expected type for that parameter.
 <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>
@@ -1982,6 +2341,13 @@ is not compatible with the expected type for that parameter.
 <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>
@@ -1990,9 +2356,9 @@ is not compatible with the expected type for that parameter.
 <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">
@@ -2085,6 +2451,14 @@ identified by the TZDate object.
                 </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>
@@ -2110,6 +2484,17 @@ identified by the TZDate object.
                 </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>
@@ -2135,6 +2520,17 @@ identified by the TZDate object.
                 </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>
@@ -2145,12 +2541,14 @@ identified by the TZDate object.
  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>);
@@ -2163,14 +2561,19 @@ identified by the TZDate object.
             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>
@@ -2203,6 +2606,17 @@ The default value is "MSECS" (milliseconds unit).
             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>
@@ -2459,6 +2873,7 @@ is not compatible with the expected type for that parameter.
   };
 
   [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 {
@@ -2564,12 +2979,14 @@ is not compatible with the expected type for that parameter.
   };
 
   [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>);
index 41a5a0d..4de7cb5 100644 (file)
@@ -522,6 +522,25 @@ The intersection - used to filter objects that match all the filters it includes
  tizen.content.find(findCB, errorCB, null, filter, null, count, offset);
  </pre>
 </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // The following example retrieves all songs from the album "Tormato" and all songs by artist "Rush".
+ var count = 100;
+ var offset = 0;
+ var artistFilter = new tizen.AttributeFilter("artists", "EXACTLY", "Rush");
+ var albumFilter = new tizen.AttributeFilter("album", "EXACTLY", "Tormato");
+ var filter = new tizen.CompositeFilter("UNION", [albumFilter, artistFilter]);
+
+ function errorCB(err) {
+     console.log( 'The following error occurred: ' +  err.name);
+ }
+
+ function findCB(contents) {
+     console.log('Songs found:' + contents.length);
+ }
+
+ tizen.content.find(findCB, errorCB, null, filter, null, count, offset);
+ </pre>
+</div>
         
       <div class="constructors">
 <h4 id="CompositeFilter::constructor">Constructors</h4>
@@ -655,6 +674,28 @@ By default, this attribute is set to <var>ASC</var>.
 Latitude and longitude are of the WGS84 datum.
           </p>
          </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">   // This example utilizes methods from Tizen's HAM module to get current latitude and longitude.
+   var myPosition;
+
+   // reads current position from the GPS module.
+   function onChangedCB(info) {
+     var latitude, longitude;
+     latitude = info.gpsInfo[0].latitude;
+     longitude = info.gpsInfo[0].longitude;
+
+     // packs these values in one variable:
+     myPosition = new SimpleCoordinates(latitude, longitude);
+   }
+
+   // starts monitoring GPS info periodically.
+   try {
+     tizen.humanactivitymonitor.start("GPS", onChangedCB, {callbackInterval: 120000, sampleInterval: 60000});
+   } catch (err) {
+     console.log(err.name + ": " + err.message);
+   }
+ </pre>
+</div>
 <div class="constructors">
 <h4 id="SimpleCoordinates::constructor">Constructors</h4>
 <dl><pre class="webidl prettyprint">SimpleCoordinates(double latitude, double longitude);</pre></dl>
@@ -1365,6 +1406,7 @@ it silently fails and there is no further action.
 
   [Callback=FunctionOnly, NoInterfaceObject]
   interface ErrorCallback {
+
     void onerror (<a href="#WebAPIError">WebAPIError</a> error);
   };
 };</pre>