Currently, I am working on a project using Bootstrap5 and I need to adjust the calendar to match the design in Figma. At the moment, my calendar looks like this:
https://i.sstatic.net/MBuKVbVpm.jpg
However, I want it to look like the second image that I am attaching from Figma:
https://i.sstatic.net/Zxq26hmSm.jpg
I have tried to style the class of the datepicker table but so far nothing has worked.
$(function() {
$('input[name="daterange"]').daterangepicker({
opens: 'right',
locale: {
format: 'MMM D, YYYY',
applyLabel: 'Apply', // Custom "Apply" button label
cancelLabel: 'Cancel',
daysOfWeek: ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
},
startDate: moment().subtract(29, 'days'),
endDate: moment(),
});
});
.daterangepicker {
width: 752px;
height: 470px;
border-radius: 9px;
border: none;
background: #FFF;
box-shadow: 0px 16px 23.5px 0px rgba(0, 0, 0, 0.15);
}
.daterangepicker:before {
position: relative;
border-right: none;
border-left: none;
top: 0;
}
.daterangepicker .drp-calendar {
margin: 20px;
width: 372px;
}
table>thead>tr:nth-child(1) {
position: relative;
width: 372px;
}
table>thead>tr:nth-child(1)::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
background-color: #BDBDBD;
}
.daterangepicker .calendar-table .prev span {
/* background-image: url("/assets/images/chevron-left.png"); */
border: solid #828282;
border-width: 0 2px 2px 0;
/* width: 21px;
height: 21px */
}
.daterangepicker .calendar-table .month {
color: #828282;
text-align: center;
font-size: 17px;
font-style: normal;
font-weight: 600;
line-height: normal;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c5e5353484f484e5d4c7c09120f120c115d504c545d0d">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="600a111505121920534e564e50">[email protected]</a>/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b4d9dbd9d1dac0f4869a868d9a85">[email protected]</a>/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.js"></script>
<div class="container mt-5">
<input type="text" name="daterange" class="form-control" placeholder="Start Date - End Date" id="datefilter">
</div>