Skip to content

Commit

Permalink
Merge pull request #443 from verdigado/task/datetimepicker-events
Browse files Browse the repository at this point in the history
Set end of event to start of event in Datepicker
  • Loading branch information
albig authored Nov 17, 2023
2 parents 989f6ad + d197de7 commit 9697fa4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
7 changes: 0 additions & 7 deletions assets/css/editor-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
font-style: normal;
font-display: swap; }

@font-face {
font-family: ForkAwesome;
font-style: normal;
font-weight: 400;
src: url("../fonts/forkawesome-webfont.woff") format("woff");
font-display: block; }

@font-face {
font-family: Sarabun;
src: url("../fonts/sarabun-v12-latin-regular.woff") format("woff");
Expand Down
30 changes: 14 additions & 16 deletions assets/custom-jquery-date-time-picker.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
jQuery( document ).ready(function() {
jQuery.datetimepicker.setLocale('de');

jQuery('.datetimepicker').datetimepicker({
i18n:{
de:{
months:[
'Januar','Februar','März','April',
'Mai','Juni','Juli','August',
'September','Oktober','November','Dezember',
],
dayOfWeek:[
"So", "Mo", "Di", "Mi",
"Do", "Fr", "Sa.",
]
}
},
jQuery('input.datetimepicker[name="_sunflower_event_from"]').datetimepicker({
timepicker: true,
dayOfWeekStart: 1,
format:'d.m.Y H:i'
format:'d.m.Y H:i',
});
});

jQuery('input.datetimepicker[name="_sunflower_event_until"]').datetimepicker({
timepicker: true,
dayOfWeekStart: 1,
format:'d.m.Y H:i',
onShow:function( ct ){
this.setOptions({
value:jQuery('input.datetimepicker[name="_sunflower_event_until"]').val()?jQuery('input.datetimepicker[name="_sunflower_event_until"]').val():jQuery('input.datetimepicker[name="_sunflower_event_from"]').val()
});
},
});

});
2 changes: 1 addition & 1 deletion functions/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function sunflower_event_field( $id, $config, $value ) {
switch ( $type ) {
case 'checkbox':
printf(
'%2$s<input class="%4$s" type="checkbox" name="%1$s" id="%1$s" %3$s value="checked"><br>',
'<div><span><input class="%4$s" type="checkbox" name="%1$s" id="%1$s" %3$s value="checked"></span><label for="%1$s">%2$s</label></div>',
$id,
$label,
( $value ) ?: '',
Expand Down

0 comments on commit 9697fa4

Please sign in to comment.