<div class="container-fluid">
<div class="form-group">
<label for="theInputDate">InputDate:</label>
<input id="theInputDate">
</div>
<div class="form-group">
<label for="theInputTime">InputTime:</label>
<input id="theInputTime">
</div>
<p>
현재 날짜/시간은 : <b><span id="dateTime"></span></b>입니다.
</p>
</div>
xxxxxxxxxx
label {
width: 120px;
text-align: right;
margin-right: 3px;
}
@font-face {
font-family: 'S-CoreDream-3Light';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff') format('woff');
font-weight: normal;
font-style: normal;
}
body {
margin: 20px;
font-family: 'S-CoreDream-3Light';
}
.container-fluid{
background-color:#ededed;
padding:10px;
border-radius:10px;
}
xxxxxxxxxx
document.readyState === 'complete' ? init() : window.onload = init;
//
function init() {
// 입력 시간 컨트롤
let theInputTime = new wijmo.input.InputTime('#theInputTime', {
format: 'h:mm tt',
min: '9:00',
max: '17:00',
step: 30,
isEditable: true,
valueChanged: (sender) => setDateTime(sender.value)
});
//
// 시간 변경 없이 날짜 편집 가능 표시
let theInputDate = new wijmo.input.InputDate('#theInputDate', {
valueChanged: (sender) => setDateTime(sender.value)
});
//
// 날짜/시간 값 초기화 및 업데이트
let dt = new Date();
dt.setHours(17, 30);
setDateTime(dt);
//
function setDateTime(value) {
let el = document.querySelector('#dateTime');
el.textContent = wijmo.Globalize.format(value, 'F');
//
theInputDate.value = value;
theInputTime.value = value;
}
}