Skip to content

feature: use datepicker in metabox for alarm time and end time#443

Open
marvger wants to merge 5 commits into
abrain:developfrom
marvger:feature/date-picker
Open

feature: use datepicker in metabox for alarm time and end time#443
marvger wants to merge 5 commits into
abrain:developfrom
marvger:feature/date-picker

Conversation

@marvger

@marvger marvger commented Jan 19, 2026

Copy link
Copy Markdown

Hi Andreas (@abrain),
ich habe hier einmal ein kleines "Feature" - ein Date-Picker anstatt des plain-text Feldes für die Auswahl der Alarm- und Endzeit.

In Zukunft werde ich vermutlich häufiger mal contributen! ;)

Diese Changes setzen #272 um.

@abrain abrain left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke für deine erste Contribution.

Comment on lines -98 to -116
- name: Upload code coverage to Codecov (unit)
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: ${{github.workspace}}/build/logs/clover.xml
flags: unit

- name: Upload code coverage to Codecov (integration)
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: ${{github.workspace}}/build/logs/clover-integration.xml
flags: integration


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diese Änderung war vermutlich ein Versehen? Hängt zumindest nicht mit dem Kern des PR zusammen.

* @param string $value Feldwert
* @param string $placeholder Platzhalter
*/
protected function echoInputDateTime(string $label, string $name, string $value, string $placeholder = '')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das placeholder-Attribut bitte entfernen, bei Datumsfeldern gibt es das nicht. Siehe https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes

jQuery(function () {
const datumsregex = /^(19|20)\d{2}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):([0-5][0-9])$/;
const datumsregex = /^(19|20)\d{2}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9])$/;
const hinweistext = __('Please use the following format: YYYY-MM-DD hh:mm', 'einsatzverwaltung');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das Format hat der User nicht mehr selbst in der Hand, daher könnte der Hinweis jetzt etwas allgemeiner formuliert sein, dass das Datum nicht vollständig oder korrekt ist.

Beim Einsatzende ist die Prüfung vermutlich wirkungslos, da bei einem unvollständig oder falsch eingegebenem Datum der Wert "" sein wird und das nicht von einem bewussten Weglassen der Angabe zu unterscheiden ist.

Am saubersten wäre es wohl, die JavaScript-Prüfung wegzulassen und mit der CSS-Pseudoklasse :invalid eine ungültige Eingabe anzuzeigen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants