Inserting date fields in Divi
In this article, I’ll show you how to create a date picker in Divi
1. adding a new date field
Click on the settings in a Divi
pa-date-time-picker
![](https://noprob.olbricht.it/wp-content/uploads/2021/06/Datumsfeld.png)
2. adding a plugin
Now that you have set the field ID in the Divi
![](https://noprob.olbricht.it/wp-content/uploads/2021/06/Inputfield.png)
3. customize the settings of the plugin
Next, we need to add a simple line of code to the plugin settings.
Go to Settings>Date & Time Picker and insert the following line:
input[data-original_id=’pa-date-time-picker’]
When you are finished, it will look like the following picture. Make sure you save it.
![](https://noprob.olbricht.it/wp-content/uploads/2021/06/CSS-Selector.png)
4. make optional adjustments to the design
We use the method described in this tutorial for our callback contact form. We’ve changed the styles of the plugin a lot and included the code below so you can use it if you want. You can adjust the colors etc. according to your wishes and add this to the CSSCSS ( Cascading style sheets ) means “multi-level format templates” in German. CSS is a formatting language for HTML, SVG and XML documents. CSS is used to separate the content of a website from the design! There is more information here . field Divi>Theme Options.
.xdsoft_datetimepicker {
box-shadow: 0 15px 40px 6px rgba(0, 0, 0, 0.1)!important;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current {
background: #2cba6c;
box-shadow: #2cba6c 0 1px 3px 0 inset;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default:hover {
background: #e03574!important;
box-shadow: #e03574 0 1px 3px 0 inset!important;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
color: #e03574!important;
}
.xdsoft_datetimepicker .xdsoft_datepicker {
width: 350px!important;
}
.xdsoft_datetimepicker .xdsoft_timepicker {
width: 100px!important;
}
.xdsoft_datetimepicker .xdsoft_calendar td,
.xdsoft_datetimepicker .xdsoft_calendar th {
background: #ffffff;
border: 2px solid #ebf8f1;
}
.xdsoft_datetimepicker.xdsoft_noselect.xdsoft_default {
padding: 20px;
border-radius: 10px;
border: none;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div {
background: #ffffff;
border-top: 2px solid #ebf8f1;
color: #333;
font-size: 16px;
text-align: center;
border-collapse: collapse;
cursor: pointer;
border-bottom-width: 0;
height: 36px;
line-height: 36px;
padding: 0 8px;
}
.xdsoft_datetimepicker .xdsoft_calendar td,
.xdsoft_datetimepicker .xdsoft_calendar th {
background: #ffffff;
border: 2px solid #ebf8f1;
color: #333;
font-size: 16px;
height: 36px;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box {
border-bottom: 2px solid #ebf8f1;
}
.xdsoft_time_box {
border: 2px solid #ebf8f1;
}
The image below shows how our contact form selects the date and time.
![](https://noprob.olbricht.it/wp-content/uploads/2021/06/Terminauswahl.png)
Dieser Beitrag ist auch verfügbar auf:
Deutsch (German)