Merge pull request #301 from misol/lets-date

날짜 선택기 개선 작업
This commit is contained in:
MinSoo Kim 2016-03-12 23:50:43 +09:00
commit 64ce9520e7
85 changed files with 3065 additions and 36 deletions

View file

@ -66,16 +66,33 @@ jQuery(function($){
});
});
(function($){
$(function(){
var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', dateFormat:'yy-mm-dd', onSelect:function(){
$(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
};
$.extend(option,$.datepicker.regional['{$lang_type}']);
$(".inputDate").datepicker(option);
$(function(){
// check if the browser support type date.
if ( $(".inputDate").prop('type') != 'date' ) {
var option = {
changeMonth: true,
changeYear: true,
gotoCurrent: false,
yearRange:'-200:+10',
dateFormat:'yy-mm-dd',
defaultDate: new Date("{date('Y-m-d',time())}"),
minDate: new Date("{date('Y-m-d',strtotime('-200 years'))}"),
onSelect:function(){
$(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))
}
};
$.extend($.datepicker.regional['{$lang_type}'],option);
//if the browser does not support type date input, start datepicker. If it does, brower's UI will show their datepicker.
$(".inputDate").datepicker(option);
} else {
$(".inputDate").prop('readonly', false);
}
$(".dateRemover").click(function() {
$(this).prevAll('input').val('');
return false;});
});
});
})(jQuery);
</script>
<include target="./common_footer.html" />

View file

@ -72,7 +72,7 @@
</div>
</form>
<script>
jQuery(function($){
(function($){
// label for setup
$('.control-label[for]').each(function(){
var $this = $(this);
@ -80,19 +80,34 @@ jQuery(function($){
$this.attr('for', $this.next().children(':visible:first').attr('id'));
}
});
});
(function($){
$(function(){
var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', dateFormat:'yy-mm-dd', onSelect:function(){
$(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
};
$.extend(option,$.datepicker.regional['{$lang_type}']);
$(".inputDate").datepicker(option);
$(function(){
// check if the browser support type date.
if ( $(".inputDate").prop('type') != 'date' ) {
var option = {
changeMonth: true,
changeYear: true,
gotoCurrent: false,
yearRange:'-200:+10',
dateFormat:'yy-mm-dd',
defaultDate: new Date("{date('Y-m-d',time())}"),
minDate: new Date("{date('Y-m-d',strtotime('-200 years'))}"),
onSelect:function(){
$(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))
}
};
$.extend($.datepicker.regional['{$lang_type}'],option);
//if the browser does not support type date input, start datepicker. If it does, brower's UI will show their datepicker.
$(".inputDate").datepicker(option);
} else {
$(".inputDate").prop('readonly', false);
}
$(".dateRemover").click(function() {
$(this).prevAll('input').val('');
return false;});
});
})(jQuery);
</script>
<include target="./common_footer.html" />
<include target="./common_footer.html" />