jquery datepicker 선택한 날짜의 요일을 얻기
jQuery 달력에서 선택한 날짜의 요일을 얻으려면 다음과 같은 방법을 사용할 수 있습니다.
1. Date 객체를 생성하여 선택한 날짜를 가져옵니다.
[code]
var selectedDate = $('#calendar').datepicker('getDate');
[/code]
2. Date 객체에서 getDay() 메서드를 사용하여 요일을 가져옵니다. 일요일부터 토요일까지 0부터 6까지의 숫자로 반환됩니다.
[code]
var dayOfWeek = selectedDate.getDay();
[/code]
3. 요일을 원하는 형식으로 표시하려면 배열이나 조건문을 사용할 수 있습니다.
[code]
var daysOfWeek = ['일', '월', '화', '수', '목', '금', '토'];
var dayOfWeekName = daysOfWeek[dayOfWeek];
console.log(dayOfWeekName); // 예: "월"
[/code]
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4946 | node.js | 6년 전 | 2609 | ||
| 4945 | node.js | 6년 전 | 2379 | ||
| 4944 | node.js | 6년 전 | 2519 | ||
| 4943 | node.js | 6년 전 | 2270 | ||
| 4942 | node.js | 6년 전 | 2246 | ||
| 4941 | node.js | 6년 전 | 2717 | ||
| 4940 | node.js | 6년 전 | 1867 | ||
| 4939 | node.js | 6년 전 | 1995 | ||
| 4938 | node.js | 6년 전 | 2459 | ||
| 4937 | node.js | 6년 전 | 2248 | ||
| 4936 | node.js | 6년 전 | 2319 | ||
| 4935 | node.js | 6년 전 | 2136 | ||
| 4934 | node.js | 6년 전 | 2440 | ||
| 4933 | node.js | 6년 전 | 2245 | ||
| 4932 | node.js | 6년 전 | 2686 | ||
| 4931 | node.js | 6년 전 | 2070 | ||
| 4930 | node.js | 6년 전 | 1998 | ||
| 4929 | node.js | 6년 전 | 8630 | ||
| 4928 | node.js | 6년 전 | 3749 | ||
| 4927 | node.js | 6년 전 | 2392 | ||
| 4926 | node.js | 6년 전 | 2504 | ||
| 4925 | node.js | 6년 전 | 2081 | ||
| 4924 | node.js | 6년 전 | 3373 | ||
| 4923 | node.js | 6년 전 | 2220 | ||
| 4922 | node.js | 6년 전 | 1989 | ||
| 4921 | node.js | 6년 전 | 2046 | ||
| 4920 | node.js | 6년 전 | 1764 | ||
| 4919 | node.js | 6년 전 | 2031 | ||
| 4918 | node.js | 6년 전 | 2177 | ||
| 4917 | node.js | 6년 전 | 2393 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기