.. _widgets-examples-datepicker:

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

.. raw:: html

    <iframe src="../../_static/html/forms/widgets/datepicker.html" scrolling='no' height="350px" width="100%" style="border:1px solid grey;"></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
