๐ฎ BootStrap - Date picker ํ ํ๋ฆฟ ๋ชจ์
Date picker
๋ฐ์ดํธ ํผ์ปค๋ ๋ ์ง๋ฅผ ๋ค๋ฃฐ๋ UIํ์์ผ๋ก ์ฝ๊ฒ ๋ ์ง๋ฅผ ์ ํํ๋๋ก ํ๋ ๋ชจ๋์ด๋ค.
์ธํฐ๋ท์ ์ฌ์ฉํ๋ ์ฌ๋์ ํ๋ฒ์ฏค์ ์ด๋ฌํ UI๋ฅผ ํตํด ๋ ์ง๋ฅผ ์ ํด๋ณธ ๊ฒฝํ์ด ์์ ๊ฒ์ด๋ค.
๊ทธ๋งํผ ์์ฆ ์น์ฌ์ดํธ๋ฅผ ๊ตฌ์ฑํ๋๋ฐ ๋ฐ๋์ ํ์ํ ์์ ฏ์ด๋ผ๊ณ ๋งํ ์ ์๋ค.
์ฐ์ ์๋ ์ฌ์ดํธ์ ๋ค์ด๊ฐ์ cdn์ ๋ค์ด ๋ฐ์์ค๋ค.
์ต์ ์ค์ ์ผ๋ก ํ๊ตญ์ด๋ ์ง์ํ๋ค. ํ๊ตญ์ด ๋ฒ์ ์ ์บ๋ฆฐ๋๋ฅผ ์ํ๋ค๋ฉด bootstrap-datepicker.ko.min.js ๋ฅผ ๋ก๋ํ๋ค.
bootstrap-datepicker - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
A datepicker for Bootstrap forked from Stefan Petre's (of eyecon.ro), improvements by eternicode - Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 12.5% of all websites, serving over 200 b
cdnjs.com
<!-- datepicker ๋ jquery 1.7.1 ์ด์ bootstrap 2.0.4 ์ด์ ๋ฒ์ ์ด ํ์ํจ -->
<!-- jQuery๊ฐ ๋จผ์ ๋ก๋ ๋ ํ datepicker๊ฐ ๋ก๋ ๋์ด์ผํจ.-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" >
<link rel="stylesheet" href="resources/css/plugin/datepicker/bootstrap-datepicker.css">
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/locales/bootstrap-datepicker.ko.min.js" integrity="sha512-L4qpL1ZotXZLLe8Oo0ZyHrj/SweV7CieswUODAAPN/tnqN3PA1P+4qPu5vIryNor6HQ5o22NujIcAZIfyVXwbQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
date picker ์ ์ฉ ๋ฐฉ๋ฒ
์ต์ ์ด ๊ต์ฅํ ๋ง๋ค. ํ์ํ๊ฒ๋ค๋ง ๊ณจ๋ผ์ ์ค์ ํ๋ค.
<!-- ์ฐ์ body ๋ถ๋ถ์ input tag๋ฅผ ํ๋ ๋ง๋ค์ด์ค๋ค. -->
<body>
<!-- ์์์ ๊ธฐ๋ณธ ๋ ์ง ์ค์ ์ value๋ฅผ ์ด์ฉ -->
<input type="text" id="datePicker" class="form-control" value="2019-06-27" />
</body>
<script>
$('#datePicker')
.datepicker({
format: 'yyyy-mm-dd', //๋ฐ์ดํฐ ํฌ๋งท ํ์(yyyy : ๋
mm : ์ dd : ์ผ )
startDate: '-10d', //๋ฌ๋ ฅ์์ ์ ํ ํ ์ ์๋ ๊ฐ์ฅ ๋น ๋ฅธ ๋ ์ง. ์ด์ ์ผ๋ก๋ ์ ํ ๋ถ๊ฐ๋ฅ ( d : ์ผ m : ๋ฌ y : ๋
w : ์ฃผ)
endDate: '+10d', //๋ฌ๋ ฅ์์ ์ ํ ํ ์ ์๋ ๊ฐ์ฅ ๋๋ฆฐ ๋ ์ง. ์ดํ๋ก ์ ํ ๋ถ๊ฐ ( d : ์ผ m : ๋ฌ y : ๋
w : ์ฃผ)
autoclose: true, //์ฌ์ฉ์๊ฐ ๋ ์ง๋ฅผ ํด๋ฆญํ๋ฉด ์๋ ์บ๋ฆฐ๋๊ฐ ๋ซํ๋ ์ต์
calendarWeeks: false, //์บ๋ฆฐ๋ ์์ ๋ช ์ฃผ์ฐจ์ธ์ง ๋ณด์ฌ์ฃผ๋ ์ต์
๊ธฐ๋ณธ๊ฐ false ๋ณด์ฌ์ฃผ๋ ค๋ฉด true
clearBtn: false, //๋ ์ง ์ ํํ ๊ฐ ์ด๊ธฐํ ํด์ฃผ๋ ๋ฒํผ ๋ณด์ฌ์ฃผ๋ ์ต์
๊ธฐ๋ณธ๊ฐ false ๋ณด์ฌ์ฃผ๋ ค๋ฉด true
datesDisabled: ['2019-06-24', '2019-06-26'], //์ ํ ๋ถ๊ฐ๋ฅํ ์ผ ์ค์ ํ๋ ๋ฐฐ์ด ์์ ์๋ format ๊ณผ ํ์์ด ๊ฐ์์ผํจ.
daysOfWeekDisabled: [0, 6], //์ ํ ๋ถ๊ฐ๋ฅํ ์์ผ ์ค์ 0 : ์ผ์์ผ ~ 6 : ํ ์์ผ
daysOfWeekHighlighted: [3], //๊ฐ์กฐ ๋์ด์ผ ํ๋ ์์ผ ์ค์
disableTouchKeyboard: false, //๋ชจ๋ฐ์ผ์์ ํ๋ฌ๊ทธ์ธ ์๋ ์ฌ๋ถ ๊ธฐ๋ณธ๊ฐ false ๊ฐ ์๋ true๊ฐ ์๋ ์ํจ.
immediateUpdates: false, //์ฌ์ฉ์๊ฐ ๋ณด๋ ํ๋ฉด์ผ๋ก ๋ฐ๋ก๋ฐ๋ก ๋ ์ง๋ฅผ ๋ณ๊ฒฝํ ์ง ์ฌ๋ถ ๊ธฐ๋ณธ๊ฐ :false
multidate: false, //์ฌ๋ฌ ๋ ์ง ์ ํํ ์ ์๊ฒ ํ๋ ์ต์
๊ธฐ๋ณธ๊ฐ :false
multidateSeparator: ',', //์ฌ๋ฌ ๋ ์ง๋ฅผ ์ ํํ์ ๋ ์ฌ์ด์ ๋ํ๋๋ ๊ธ์ง 2019-05-01,2019-06-01
templates: {
leftArrow: '«',
rightArrow: '»',
}, //๋ค์๋ฌ ์ด์ ๋ฌ๋ก ๋์ด๊ฐ๋ ํ์ดํ ๋ชจ์ ์ปค์คํ
๋ง์ด์ง
showWeekDays: true, // ์์ ์์ผ ๋ณด์ฌ์ฃผ๋ ์ต์
๊ธฐ๋ณธ๊ฐ : true
title: 'ํ
์คํธ', //์บ๋ฆฐ๋ ์๋จ์ ๋ณด์ฌ์ฃผ๋ ํ์ดํ
todayHighlight: true, //์ค๋ ๋ ์ง์ ํ์ด๋ผ์ดํ
๊ธฐ๋ฅ ๊ธฐ๋ณธ๊ฐ :false
toggleActive: true, //์ด๋ฏธ ์ ํ๋ ๋ ์ง ์ ํํ๋ฉด ๊ธฐ๋ณธ๊ฐ : false์ธ๊ฒฝ์ฐ ๊ทธ๋๋ก ์ ์ง true์ธ ๊ฒฝ์ฐ ๋ ์ง ์ญ์
weekStart: 0, //๋ฌ๋ ฅ ์์ ์์ผ ์ ํํ๋ ๊ฒ ๊ธฐ๋ณธ๊ฐ์ 0์ธ ์ผ์์ผ
language: 'ko', //๋ฌ๋ ฅ์ ์ธ์ด ์ ํ, ๊ทธ์ ๋ง๋ js๋ก ๊ต์ฒดํด์ค์ผํ๋ค.
})
.on('changeDate', function (e) {
/* ์ด๋ฒคํธ์ ์ข
๋ฅ */
//show : datePicker๊ฐ ๋ณด์ด๋ ์๊ฐ ํธ์ถ
//hide : datePicker๊ฐ ์จ๊ฒจ์ง๋ ์๊ฐ ํธ์ถ
//clearDate: clear ๋ฒํผ ๋๋ฅด๋ฉด ํธ์ถ
//changeDate : ์ฌ์ฉ์๊ฐ ํด๋ฆญํด์ ๋ ์ง๊ฐ ๋ณ๊ฒฝ๋๋ฉด ํธ์ถ (๊ฐ์ธ์ ์ผ๋ก ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉํจ)
//changeMonth : ์์ด ๋ณ๊ฒฝ๋๋ฉด ํธ์ถ
//changeYear : ๋
์ด ๋ณ๊ฒฝ๋๋ ํธ์ถ
//changeCentury : ํ ์ธ๊ธฐ๊ฐ ๋ณ๊ฒฝ๋๋ฉด ํธ์ถ ex) 20์ธ๊ธฐ์์ 21์ธ๊ธฐ๊ฐ ๋๋ ์๊ฐ
console.log(e);
// e.date๋ฅผ ์ฐ์ด๋ณด๋ฉด Thu Jun 27 2019 00:00:00 GMT+0900 (ํ๊ตญ ํ์ค์) ์์ ๊ฐ์ ํํ๋ก ๋ณด์ธ๋ค.
});
</script>
๋ค์ํ ๋ฌ๋ ฅ ํ ํ๋ฆฟ ๋ชจ์
๊ธฐ๋ณธ ํ ํ๋ฆฟ์ด ์์ํ๋ฉด, ๋ฉ์ง๊ณ ๋ค์ํ ๋์์ธ์ ๊ณจ๋ผ ๋ฐ์ ์ ์๋ค.
Bootstrap 5 - Datepicker - using Vanilla JS
Date-picker for Bootstrap 5, using vanilla JavaScript with vanillajs-datepicker. Examples of floating labels, input groups and mixed....
codepen.io
Calendar V17
A Bootstrap-based free inline calendar template that features the result (selected date) at the top of the block.
colorlib.com
Calendar V12
The easiest to use modern, responsive and free date picker template based on the well-liked Bootstrap Framework.
colorlib.com
Calendar V09
A modern free calendar date picker template with an option to select the exact time that uses Bootstrap as a base.
colorlib.com
Bootstrap 4 datepicker input form with button Example
Bootstrap 4 datepicker input form with button snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 green themed datepicker with date range Example
Bootstrap 4 green themed datepicker with date range snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 orange themed datepicker with date range Example
Bootstrap 4 orange themed datepicker with date range snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 pink themed custom datepicker Example
Bootstrap 4 pink themed custom datepicker snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 business hours table with custom time Example
Bootstrap 4 business hours table with custom time snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 Dark themed date and time picker Example
Bootstrap 4 Dark themed date and time picker snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 date range datepicker with two months shown Example
Bootstrap 4 date range datepicker with two months shown snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 green themed datepicker with date range Example
Bootstrap 4 green themed datepicker with date range snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap 4 datepicker using html and jquery plugin Example
Bootstrap 4 datepicker using html and jquery plugin snippet for your project ๐๐. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
bbbootstrap.com
Bootstrap Datepicker - JSFiddle - Code Playground
jsfiddle.net
Bootstrap Date/Time Picker
Custom bootstrap styling for Eonasdan's DateTimePicker....
codepen.io
Bootstrap Datepicker Demo
Using a bootstrap datepicker and the getDate method to add a second string with different date formatting....
codepen.io
GitHub - eureka2/ab-datepicker: An accessible and bootstrap compatible datepicker
An accessible and bootstrap compatible datepicker. Contribute to eureka2/ab-datepicker development by creating an account on GitHub.
github.com
GitHub - T00rk/bootstrap-material-datetimepicker: Datepicker for bootstrap-material
Datepicker for bootstrap-material. Contribute to T00rk/bootstrap-material-datetimepicker development by creating an account on GitHub.
github.com
GitHub - monim67/bootstrap-datetimepicker: Bootstrap 3/4 Date/Time Picker with clock-like Time-Picker
Bootstrap 3/4 Date/Time Picker with clock-like Time-Picker - GitHub - monim67/bootstrap-datetimepicker: Bootstrap 3/4 Date/Time Picker with clock-like Time-Picker
github.com
GitHub - jtsage/jtsage-datebox: A multi-mode date and time picker for Bootstrap (3&4), jQueryMobile, Foundation, Bulma, Fomantic
A multi-mode date and time picker for Bootstrap (3&4), jQueryMobile, Foundation, Bulma, FomanticUI, and UIKit (or others) - GitHub - jtsage/jtsage-datebox: A multi-mode date and time picker for...
github.com