Force dateFormat to dd/mm/yyyy for all locales
To maintain consistency and the use of advanced search in the frontend, we forced the expected date format for all languages. This is a temporary solution that we should analyze in depth to allow different date formats depending on the language in the filters.
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
});
|
});
|
||||||
$(".js-calendar-full").datepicker();
|
$(".js-calendar-full").datepicker();
|
||||||
$.datepicker.setDefaults($.datepicker.regional[locale]);
|
$.datepicker.setDefaults($.datepicker.regional[locale]);
|
||||||
|
$.datepicker.setDefaults({ dateFormat: "dd/mm/yy" });
|
||||||
},
|
},
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
App.AdvancedSearch.init_calendar();
|
App.AdvancedSearch.init_calendar();
|
||||||
|
|||||||
@@ -179,6 +179,17 @@ describe "Admin banners magement" do
|
|||||||
expect(page).not_to have_content "Wrong text"
|
expect(page).not_to have_content "Wrong text"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "when change date field on edit banner page display expected format", :js do
|
||||||
|
banner = create(:banner)
|
||||||
|
visit edit_admin_banner_path(banner)
|
||||||
|
|
||||||
|
fill_in "Post started at", with: "20/02/2002"
|
||||||
|
find_field("Post started at").click
|
||||||
|
within(".ui-datepicker") { click_link "22" }
|
||||||
|
|
||||||
|
expect(page).to have_field "Post started at", with: "22/02/2002"
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Delete a banner" do
|
scenario "Delete a banner" do
|
||||||
create(:banner, title: "Ugly banner",
|
create(:banner, title: "Ugly banner",
|
||||||
description: "Bad text",
|
description: "Bad text",
|
||||||
|
|||||||
Reference in New Issue
Block a user