mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
localize flatpickr date format
Flatpickr can format date. Use a localized dateFormat.
This commit is contained in:
@@ -25,7 +25,7 @@ $(document).ready(function(){
|
||||
}
|
||||
);
|
||||
window.FLATPICKR_DATE_DEFAULT = {
|
||||
dateFormat: "Y-m-d H:i",
|
||||
dateFormat: Spree.translations.flatpickr_date_format,
|
||||
locale: I18n.locale
|
||||
}
|
||||
window.FLATPICKR_DATETIME_DEFAULT = Object.assign(
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
{ :date_picker => Spree.t(:js_format,
|
||||
:scope => 'date_picker',
|
||||
:default => 'yy/mm/dd'),
|
||||
:flatpickr_date_format => Spree.t(:flatpickr_date_format,
|
||||
:scope => 'date_picker',
|
||||
:default => 'Y-m-d H:i'),
|
||||
:abbr_day_names => I18n.t(:abbr_day_names, :scope => :date),
|
||||
:add => I18n.t(:add, scope: :actions),
|
||||
:are_you_sure_delete => Spree.t(:are_you_sure_delete),
|
||||
|
||||
@@ -3595,6 +3595,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
date_picker:
|
||||
format: ! '%Y-%m-%d'
|
||||
js_format: 'yy-mm-dd'
|
||||
flatpickr_date_format: "Y-m-d H:i"
|
||||
orders:
|
||||
error_flash_for_unavailable_items: "An item in your cart has become unavailable. Please update the selected quantities."
|
||||
edit:
|
||||
|
||||
Reference in New Issue
Block a user