.. _widgets-examples-datepicker:

Пример использования AS.SERVICES.showDatePicker
""""""""""""""""""""""""""""""""""""""""""""""""

.. raw:: html

    <iframe src="../../_static/html/forms/widgets/datepicker.html" scrolling='no' frameBorder="0" height="350px" width="100%"></iframe>

Исходный код функции

.. code-block:: js

    $("[data-asformid='textbox.input.textbox-cmp']").click(function () {
        AS.SERVICES.showDatePicker(new Date(),
                $("[data-asformid='textbox.input.textbox-cmp']"),
                $("[data-asformid='textbox.input.textbox-cmp']"),
                function (date) {
                    model.setValue(AS.FORMS.DateUtils.formatDate(date, "${dd} ${monthed} ${yyyy}г."));
                });
    });

Полный исходный код

.. literalinclude:: ../../_static/html/forms/widgets/datepicker.html
    :language: html
    :emphasize-lines: 63-72
    :encoding: utf-8
