×
Namespaces

Variants
Actions
(Difference between revisions)

Date

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
m (Protected "Date" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
hkaliste (Talk | contribs)
Line 2: Line 2:
 
=Inheritance=  
 
=Inheritance=  
 
<code>Nokia.Widget
 
<code>Nokia.Widget
 
+
    | - Nokia.Date
| - Nokia.Date
+
 
</code>
 
</code>
  
Line 25: Line 24:
 
<pre>
 
<pre>
 
<!-- Themeroller CSS -->
 
<!-- Themeroller CSS -->
<link rel="stylesheet" href="/themes/themeroller/default-theme/THEMEROLLER.css" type="text/css" media="screen">
+
<link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen">
<!-- Nokia WRT Framework Base CSS -->
+
<link rel="stylesheet" href="/themes/nokia/base/JS4WRT.css" type="text/css" media="screen">
+
 
<!-- Specific Theme/Resolution CSS -->
 
<!-- Specific Theme/Resolution CSS -->
 
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">
 
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">
Line 37: Line 34:
 
<pre>
 
<pre>
 
<!-- jQuery file -->
 
<!-- jQuery file -->
<script src="/lib/jquery/JQUERY.js" type="text/javascript" charset="utf-8"></script>
+
<script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script>
<!-- JS4WRT file -->
+
<!-- Guarana file -->
<script src="/lib/JS4WRT.js" type="text/javascript" charset="utf-8"></script>
+
<script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>
</pre>
+
</pre>  
  
 
=4 - Functional Specifications/Requirements=
 
=4 - Functional Specifications/Requirements=

Revision as of 17:52, 18 November 2009

Inheritance

Nokia.Widget
| - Nokia.Date

1 - Description

The most popular use of this component is a form where one of the fields is a date. Such forms may ask for a birth date, friends' birthdays, or even a date for an appointment. The Date component will display three fields, day, month, and year. The developer can choose the order of the fields. The user will input the date in the fields.


2 - Visual Design

Datepicker01.png

3 - Component Dependencies

3.1 CSS

<!-- Themeroller CSS -->
<link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen">
<!-- Specific Theme/Resolution CSS -->
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">


3.2 Javascript

<!-- jQuery file -->
<script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script>
<!-- Guarana file -->
<script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>

4 - Functional Specifications/Requirements

4.1 - Options

  • element: 'selector'
    • jQuery selector or the DOM reference to become the container of the component.
  • format: String
    • Defines the date format used by the component.
  • title: String
    • Defines the title used by the component.
  • yearRange: int
    • Defines the range of years used by the component.
  • i18n: String
    • Defines the internationalisation.
  • setDateDelay: int
    • Defines the time used in component interaction.
  • roundedCorners: boolean
    • Defines whether the component has rounded corners.
  • active: Class
    • Defines the CSS class used when active.
  • monthNames: Object[]
    • A list of month names.
  • monthNamesShort: Object[]
    • A list of month names in short mode.
  • dayNames: Object[]
    • A list of day names.
  • dayNamesShort: Object[]
    • A list of day names in short mode.


4.2 - Events - Callbacks

  • create: function()
    • Scope: [this.element]
  • setDay: function(day)
    • Scope: [this.element]
  • setMonth: function(month)
    • Scope: [this.element]
  • setYear: function(year)
    • Scope: [this.element]
  • setDate: function(date)
    • Scope: [this.element]

4.3 - Methods

  • getDate: function()
    • Returns the component date.
    • return [jQuery collection]
  • formatDate: function(format, date)
    • Formats the date according to a specific format.
    • return [jQuery collection]
  • setDay: function(day)
    • Sets the day property.
    • return [void]
  • setMonth: function(month)
    • Sets the month property.
    • return [void]
  • setYear: function(year)
    • Sets the year property.
    • return [int]
  • setDate: function(date)
    • Sets the date property.
    • return [void]


4.4- Default options

  • element: 'body',
  • format: 'dd/mm/yy',
  • title: 'Pick a date',
  • yearRange: 10,
  • i18n: ,
  • setDateDelay: 800,


5 - Component Demo

5.1 HTML

<div id="datepicker"></div>

5.2 Javascript

var datepicker = new Nokia.DatePicker({
     i18n: 'pt-BR',
     element: '#datepicker',
     yearRange: 5,
     roundedCorners: true,
     create: function() {
          //alert('Datepicker: created', this);
     },
     setDay: function(day) {
          //alert('Datepicker: setDay', this, day);
     },
     setMonth: function(month) {
          //alert('Datepicker: setMonth', this, month);
     },
     setYear: function(year) {
          //alert('Datepicker: setYear', this, year);
     },
     setDate: function(date) {
          //alert('Datepicker: setDate', this, date);
     }
};

6 - Nokia WRT Browser Compatibility:

 

▴   S60 3.1 S60 3.2 S60 5.0
Date NO  YES  YES 

 

54 page views in the last 30 days.
×