Unverified Commit 02a6b907 authored by Cassidy Dingenskirchen's avatar Cassidy Dingenskirchen
Browse files

/journey/edit: datetime inputs

parent 74062d4a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2383,7 +2383,7 @@ sub edit_journey {

	if ( $self->param('action') and $self->param('action') eq 'save' ) {
		my $parser = DateTime::Format::Strptime->new(
			pattern   => '%d.%m.%Y %H:%M',
			pattern   => '%FT%H:%M',
			locale    => 'de_DE',
			time_zone => 'Europe/Berlin'
		);
@@ -2486,7 +2486,7 @@ sub edit_journey {
	for my $key (qw(sched_departure rt_departure sched_arrival rt_arrival)) {
		if ( $journey->{$key} and $journey->{$key}->epoch ) {
			$self->param(
				$key => $journey->{$key}->strftime('%d.%m.%Y %H:%M') );
				$key => $journey->{$key}->strftime('%FT%H:%M') );
		}
	}

+4 −4
Original line number Diff line number Diff line
@@ -69,13 +69,13 @@
					<tr>
						<th scope="row">Geplante Abfahrt</th>
						<td class="input-field">
							%= text_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]'
							%= datetime_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef
						</td>
					</tr>
					<tr>
						<th scope="row">Tatsächliche Abfahrt</th>
						<td class="input-field">
							%= text_field 'rt_departure', id => 'real_departure', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]'
							%= datetime_field 'rt_departure', id => 'real_departure', class => 'validate'
						</td>
					</tr>
					<tr>
@@ -87,13 +87,13 @@
					<tr>
						<th scope="row">Geplante Ankunft</th>
						<td class="input-field">
							%= text_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]'
							%= datetime_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef
						</td>
					</tr>
					<tr>
						<th scope="row">Tatsächliche Ankunft</th>
						<td class="input-field">
							%= text_field 'rt_arrival', id => 'real_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]'
							%= datetime_field 'rt_arrival', id => 'real_arrival', class => 'validate'
						</td>
					</tr>
					<tr>