1. 개요


jquery-ui API 중 달력 기능 사용에 있어 기본 영문 언어에서 한글로 변경하는 방법에 대해 포스팅 합니다.

 



2. API


상세한 API 사용은 원 출처 페이지를 참고하기 바랍니다.

https://jqueryui.com/datepicker/


3. 한글 설정


<script>
if(typeof $.datepicker.regional == 'object') {
	$.datepicker.regional['kr'] = {
	    closeText: '닫기', // 닫기 버튼 텍스트 변경
	    currentText: '오늘', // 오늘 텍스트 변경
	    changeYear: true,
	    changeMonth: false,
	    monthNames: ['1 월','2 월','3 월','4 월','5 월','6 월','7 월','8 월','9 월','10 월','11 월','12 월'], // 개월 텍스트 설정
	    monthNamesShort: ['1 월','2 월','3 월','4 월','5 월','6 월','7 월','8 월','9 월','10 월','11 월','12 월'], // 개월 텍스트 설정
	    dayNames: ['월요일','화요일','수요일','목요일','금요일','토요일','일요일'], // 요일 텍스트 설정
	    dayNamesShort: ['월','화','수','목','금','토','일'], // 요일 텍스트 축약 설정   
	    dayNamesMin: ['월','화','수','목','금','토','일'], // 요일 최소 축약 텍스트 설정
	    dateFormat: 'dd/mm/yy' // 날짜 포맷 설정
	};

	// Seeting up default language, Korean
	$.datepicker.setDefaults($.datepicker.regional['kr']);
}
</script>


datepicker 호출하기 직전에 위의 소스가 먼저 호출되면 됩니다.


<script>
$("#date_popup").datepicker({
			dateFormat:'yy-mm-dd',
			showOn: "button",
			buttonImage: 'btn_calendar.gif',
			buttonImageOnly: true,
			buttonText: "Select date"
		});
</script>

<input type="text" id="date_popup" name="select_date" style="color:#787878;" onkeypress="checkInputTime(event);" onfocus="blur();" />

 

 


 

4. 출처


https://jqueryui.com/

'웹 프로그래밍 > JavaScript' 카테고리의 다른 글

[jquery] Flight Indicator API  (0) 2020.06.18

1. 개요

 

jquery UI API 중에서 지도와 연계하여 사용하기 좋은 비행 계기판 관련 API를 소개하고자 한다.

 

(개발자 git 에서 발췌한 UI 이미지)

 

다섯 가지 외에 추가로 turn coordinator 라는 API 도 있는데 해당 API 의 경우 IE 에서는 사이즈 변경이 안되는 오류가 있어서 소개되어 있지 않으나 API 상에는 존재함

 

(존재하나 소개 되지 않은 API UI)

 

 

2. 사용방법

 


<head>
<script src="js/jquery.flightindicators.js"></script>
<link rel="stylesheet" type="text/css" href="css/flightindicators.css" />
</head>

<body>
<span id="attitude"></span>
<script>
     var indicator = $.flightIndicator('#attitude', 'attitude', {size:200, showBox : showBox});
     indicator.setRoll(15);
     indicator.setPitch(7.5);
</script>
</body>


3. 출처

 

https://github.com/sebmatton/jQuery-Flight-Indicators

 

 

 

 

 

 

'웹 프로그래밍 > JavaScript' 카테고리의 다른 글

[jquery] datepicker 한글 설정  (0) 2020.08.19

+ Recent posts