Style Sheet/Bootstrap5

๐Ÿ”ฎ BootStrap - Date picker ํ…œํ”Œ๋ฆฟ ๋ชจ์Œ

์ธํŒŒ_ 2021. 10. 23. 00:33

Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

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

Date-picker-

<!-- 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: '&laquo;',
            rightArrow: '&raquo;',
         }, //๋‹ค์Œ๋‹ฌ ์ด์ „๋‹ฌ๋กœ ๋„˜์–ด๊ฐ€๋Š” ํ™”์‚ดํ‘œ ๋ชจ์–‘ ์ปค์Šคํ…€ ๋งˆ์ด์ง•
         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>

๋‹ค์–‘ํ•œ ๋‹ฌ๋ ฅ ํ…œํ”Œ๋ฆฟ ๋ชจ์Œ

๊ธฐ๋ณธ ํ…œํ”Œ๋ฆฟ์ด ์‹์ƒํ•˜๋ฉด, ๋ฉ‹์ง€๊ณ  ๋‹ค์–‘ํ•œ ๋””์ž์ธ์„ ๊ณจ๋ผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

Calendar V17

A Bootstrap-based free inline calendar template that features the result (selected date) at the top of the block.

colorlib.com


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

Calendar V12

The easiest to use modern, responsive and free date picker template based on the well-liked Bootstrap Framework.

colorlib.com


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

Bootstrap Datepicker - JSFiddle - Code Playground

 

jsfiddle.net


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

Bootstrap Date/Time Picker

Custom bootstrap styling for Eonasdan's DateTimePicker....

codepen.io


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

Bootstrap Datepicker Demo

Using a bootstrap datepicker and the getDate method to add a second string with different date formatting....

codepen.io


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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


Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap
Date-picker-๋ถ€ํŠธ์ŠคํŠธ๋žฉ-bootstrap

 

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