ユーザーテキストボックス入力でjQuery Datetimepickerを使用するにはどうすればよいですか?
$(document).on('click', '#txtUserDateTime', function (evt) {
$('#txtUserDateTime').datetimepicker({
format: 'm/d/Y H:i',
step: 5,
minDate: 0
});
});
上の画像では、日付と時刻を設定でき、テキストボックスは読み取り専用です。「w/c」などのテキストとして時間のみを変更したい場合がありましたが、datetimepicker テキストボックスでは、イベントの外側をクリックした後に値を保持できません。
テキストボックスはDatetimepicker("#txtUserDateTime")
ユーザー入力を許可しません。これを達成できますか?
以下は私のcshtmlコードです:
<div class="col-sm-3">
<div class="input-group date">
<span class="csts-date-time-picker" style="width: 100%;">
<input asp-for="NeedDate" type="text" id="txtCraneDateTime" class="form-control" tabindex="0">
</span>
<span asp-validation-for="NeedDate" class="text-danger"></span>
</div>
</div>