Make date picker work with karma tests where the old Spree.translations js translations object is not defined

This commit is contained in:
Luis Ramos
2020-08-21 15:08:06 +01:00
parent bfd4164c0b
commit 3af5482960

View File

@@ -116,7 +116,8 @@ $.fn.radioControlsVisibilityOfElement = function(dependentElementSelector){
}
$(document).ready(function() {
if (typeof Spree !== 'undefined') {
if (typeof Spree !== 'undefined' &&
typeof Spree.translations !== 'undefined') {
handle_date_picker_fields = function(){
$('.datepicker').datepicker({
dateFormat: Spree.translations.date_picker,