Published 2014-10-28 | (Compatible with SDK 2.5,3.5,4.5,5.0,5.1 and 2011,2012,2013,2014 models)


** This class will not be supported in 2015.

   All functionalities of AppsFramework are more improved, integrating with CAPH. Therefore Appsframework is not supported since 2015 Smart TV. To use functionalities of Appsframework, refer to here.


The Datepicker component simplifies the task of entering dates and times in the application.


Figure. Datepicker component



$.fn.sfDatepicker = function (options)
Parameter options - timePicker, date, format, callback

The values for the options parameter are:

  • timePicker - (optional) boolean - Indicates whether time is to be chosen.

    • true - “Year, Month, Day, Hour, AM/PM, Minute”
    • false - “Year, Month, Day” default : false


    $('#svecDatepicker').sfDatepicker({timePicker:false, format:'yyyy-MM-dd', callback:'0'});
  • Date - (optional) Date Object - Sets default date.
    default - Current time
  • format - (optional) String - Sets the return date format.
    default : “yyyy-MM-dd”

    The default format of the Datepicker is of the form “yyyy-MM-dd”. Any order can be used. Special symbols can be also be added in between the format. For example, “yyyy@MM@dd”. If the format is modified to a non-standard format, for example, “yyyy-DD-mm”, the datepicker will not return the correct value of the date.

  • callback - (optional) function - Callback function to be called when Datepicker is closed. The picked date is returned as a parameter. Returns the date string in the requested format


    SceneScene1.prototype.initialize = function (){
        $('#svecDatepicker_T9SZ').sfDatepicker({timePicker: false, format: 'yyyy-MM-dd', callback: dateReturned});
    // ...
    dateReturned = function (date){

    Even though the function definition takes parameters, do not specify any parameters during the function call, as shown in the above example.

  • show - Shows datepicker window. Datepicker steals focus from the Scene and returns focus when closed.


Properties ID - Component ID

Figure. Datepicker properties box