update
This commit is contained in:
parent
962caebbb7
commit
87bf53d076
1825 changed files with 94929 additions and 0 deletions
12
2-ui/5-widgets/8-widget-tasks-2/1-date-selector/source.view/dateselector.js
Executable file
12
2-ui/5-widgets/8-widget-tasks-2/1-date-selector/source.view/dateselector.js
Executable file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* options:
|
||||
* yearFrom {number} начальный год в селекторе
|
||||
* yearTo {number} конечный год в селекторе
|
||||
* value {Date} текущая выбранная дата
|
||||
*/
|
||||
function DateSelector(options) {
|
||||
var self = this;
|
||||
|
||||
|
||||
/* ваш код */
|
||||
}
|
37
2-ui/5-widgets/8-widget-tasks-2/1-date-selector/source.view/index.html
Executable file
37
2-ui/5-widgets/8-widget-tasks-2/1-date-selector/source.view/index.html
Executable file
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="http://code.jquery.com/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
|
||||
<script src="dateselector.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/template" id="date-selector-template">
|
||||
/* шаблон для виджета */
|
||||
</script>
|
||||
|
||||
<div id="selector-holder"></div>
|
||||
<div id="value">тут будет значение даты при выборе</div>
|
||||
|
||||
<script>
|
||||
var dateSelector = new DateSelector({
|
||||
yearFrom: 2010,
|
||||
yearTo: 2020,
|
||||
value: new Date(2012, 2, 31), // 31 марта 2012
|
||||
template: $('#date-selector-template').html()
|
||||
});
|
||||
|
||||
$('#selector-holder').append(dateSelector.getElement());
|
||||
|
||||
$(dateSelector).on("select", function(e) {
|
||||
$('#value').html( e.value + '' );
|
||||
});
|
||||
</script>
|
||||
|
||||
<button onclick="dateSelector.setValue(new Date)">setValue(сегодня)</button>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue