Skip to content

Commit

Permalink
Merge branch 'mampf-next' into feature/feedback-button
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Aug 26, 2023
2 parents 4fbe953 + 883417c commit d8a34f5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions app/assets/javascripts/datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,32 @@ function startInitialization() {
});
}

function getDateTimePickerIcons() {
// At the moment: continue to use FontAwesome 5 icons
// see https://getdatepicker.com/6/plugins/fa5.html
// see https://github.com/Eonasdan/tempus-dominus/blob/master/dist/plugins/fa-five.js
return {
type: 'icons',
time: 'fas fa-clock',
date: 'fas fa-calendar',
up: 'fas fa-arrow-up',
down: 'fas fa-arrow-down',
previous: 'fas fa-chevron-left',
next: 'fas fa-chevron-right',
today: 'fas fa-calendar-check',
clear: 'fas fa-trash',
close: 'fas fa-times',
}
}

function initDatetimePicker(element) {
// see https://getdatepicker.com
return new tempusDominus.TempusDominus(
element.get(0),
{
display: {
sideBySide: true, // clock to the right of the calendar
icons: getDateTimePickerIcons(),
},
localization: {
startOfTheWeek: 1,
Expand Down
5 changes: 2 additions & 3 deletions app/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<%= stylesheet_link_tag 'application',
media: 'all',
'data-turbolinks-track': 'reload' %>

<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"
integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0="
Expand Down Expand Up @@ -36,9 +37,7 @@
</script>

<!-- Tempus Dominus Datetimepicker -->
<!-- Font awesome required for icons in Datetimepicker -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/js/solid.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/js/fontawesome.min.js"></script>
<!-- Popper is required for Tempus Dominus -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/@eonasdan/[email protected]/dist/js/tempus-dominus.js">
Expand Down
1 change: 1 addition & 0 deletions config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ default: &default
development:
<<: *default
compile: true
public_output_path: assets/packs

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
Expand Down

0 comments on commit d8a34f5

Please sign in to comment.