@@ -185,44 +185,8 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
185185 */
186186 protected function getInput ()
187187 {
188- return $ this ->getRenderer ($ this ->layout )->render ($ this ->getLayoutData ());
189- }
190-
191- /**
192- * Method to get the data to be passed to the layout for rendering.
193- *
194- * @return array
195- *
196- * @since __DEPLOY_VERSION__
197- */
198- protected function getLayoutData ()
199- {
200- $ data = parent ::getLayoutData ();
201- $ tag = JFactory::getLanguage ()->getTag ();
202- $ calendar = JFactory::getLanguage ()->getCalendar ();
203188 $ config = JFactory::getConfig ();
204189 $ user = JFactory::getUser ();
205- $ direction = strtolower (JFactory::getDocument ()->getDirection ());
206-
207- // Get the appropriate file for the current language date helper
208- $ helperPath = 'system/fields/calendar-locales/date/gregorian/date-helper.min.js ' ;
209-
210- if (!empty ($ calendar ) && is_dir (JPATH_ROOT . '/media/system/js/fields/calendar-locales/date/ ' . strtolower ($ calendar )))
211- {
212- $ helperPath = 'system/fields/calendar-locales/date/ ' . strtolower ($ calendar ) . '/date-helper.min.js ' ;
213- }
214-
215- // Get the appropriate locale file for the current language
216- $ localesPath = 'system/fields/calendar-locales/en.js ' ;
217-
218- if (is_file (JPATH_ROOT . '/media/system/js/fields/calendar-locales/ ' . strtolower ($ tag ) . '.js ' ))
219- {
220- $ localesPath = 'system/fields/calendar-locales/ ' . strtolower ($ tag ) . '.js ' ;
221- }
222- elseif (is_file (JPATH_ROOT . '/media/system/js/fields/calendar-locales/ ' . strtolower (substr ($ tag , 0 , -3 )) . '.js ' ))
223- {
224- $ localesPath = 'system/fields/calendar-locales/ ' . strtolower (substr ($ tag , 0 , -3 )) . '.js ' ;
225- }
226190
227191 // Translate the format if requested
228192 $ translateFormat = (string ) $ this ->element ['translateformat ' ];
@@ -283,6 +247,43 @@ protected function getLayoutData()
283247 $ this ->value = '' ;
284248 }
285249
250+ return $ this ->getRenderer ($ this ->layout )->render ($ this ->getLayoutData ());
251+ }
252+
253+ /**
254+ * Method to get the data to be passed to the layout for rendering.
255+ *
256+ * @return array
257+ *
258+ * @since __DEPLOY_VERSION__
259+ */
260+ protected function getLayoutData ()
261+ {
262+ $ data = parent ::getLayoutData ();
263+ $ tag = JFactory::getLanguage ()->getTag ();
264+ $ calendar = JFactory::getLanguage ()->getCalendar ();
265+ $ direction = strtolower (JFactory::getDocument ()->getDirection ());
266+
267+ // Get the appropriate file for the current language date helper
268+ $ helperPath = 'system/fields/calendar-locales/date/gregorian/date-helper.min.js ' ;
269+
270+ if (!empty ($ calendar ) && is_dir (JPATH_ROOT . '/media/system/js/fields/calendar-locales/date/ ' . strtolower ($ calendar )))
271+ {
272+ $ helperPath = 'system/fields/calendar-locales/date/ ' . strtolower ($ calendar ) . '/date-helper.min.js ' ;
273+ }
274+
275+ // Get the appropriate locale file for the current language
276+ $ localesPath = 'system/fields/calendar-locales/en.js ' ;
277+
278+ if (is_file (JPATH_ROOT . '/media/system/js/fields/calendar-locales/ ' . strtolower ($ tag ) . '.js ' ))
279+ {
280+ $ localesPath = 'system/fields/calendar-locales/ ' . strtolower ($ tag ) . '.js ' ;
281+ }
282+ elseif (is_file (JPATH_ROOT . '/media/system/js/fields/calendar-locales/ ' . strtolower (substr ($ tag , 0 , -3 )) . '.js ' ))
283+ {
284+ $ localesPath = 'system/fields/calendar-locales/ ' . strtolower (substr ($ tag , 0 , -3 )) . '.js ' ;
285+ }
286+
286287 $ extraData = array (
287288 'value ' => $ this ->value ,
288289 'maxLength ' => $ this ->maxlength ,
0 commit comments