Skip to content

A free open source IT asset/license management system

Use today’s date for date format selectlist

snipe9820ab34d70d
diff --git a/resources/macros/macros.php b/resources/macros/macros.php
index 625984dafe..43dc2cc2e0 100644
--- a/resources/macros/macros.php
+++ b/resources/macros/macros.php
@@ -59,11 +59,11 @@ Form::macro('date_display_format', function ($name = 'date_display_format', $sel
];
foreach ($formats as $format) {
- $date_display_formats[$format] = Carbon::parse(date('Y').'-'.date('m').'-25')->format($format);
+ $date_display_formats[$format] = Carbon::parse(date('Y-m-d'))->format($format);
}
- $select = '<select name="'.$name.'" class="'.$class.'" style="min-width:250px" aria-label="'.$name.'">';
+ $select = '<select name="'.$name.'" class="'.$class.'" style="min-width:100%" aria-label="'.$name.'">';
foreach ($date_display_formats as $format => $date_display_format) {
- $select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected" role="option" aria-selected="true"' : ' aria-selected="false"').'">'.$format.' (Example: '.$date_display_format.')</option> ';
+ $select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected" role="option" aria-selected="true"' : ' aria-selected="false"').'">'.$date_display_format.'</option> ';
}
$select .= '</select>';
diff --git a/resources/views/settings/localization.blade.php b/resources/views/settings/localization.blade.php
index d7ec45a92c..a74387b32d 100644
--- a/resources/views/settings/localization.blade.php
+++ b/resources/views/settings/localization.blade.php
@@ -58,17 +58,15 @@
<div class="col-md-3">
{{ Form::label('time_display_format', trans('general.time_and_date_display')) }}
</div>
- <div class="col-md-10">
+ <div class="col-md-5">
{!! Form::date_display_format('date_display_format', Request::old('date_display_format', $setting->date_display_format), 'select2') !!}
</div>
<div class="col-md-3">
{!! Form::time_display_format('time_display_format', Request::old('time_display_format', $setting->time_display_format), 'select2') !!}
-
- </div>
- {!! $errors->first('time_display_format', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
- <div class="col-md-11 col-offset-3">
- <p class="help-block">The date shown in the drop-down is just an example to display the different date formats. It is not meant to reflect today's date.</p>
</div>
+
+ {!! $errors->first('time_display_format', '<div class="col-md-9 col-md-offset-3"><span class="alert-msg" aria-hidden="true">:message</span> </div>') !!}
+
</div>
<!-- Currency -->