| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait Localize |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Override locale. If empty will default to current locale |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $locale = null; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Get locale to use for this field |
||
| 18 | * |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | public function getLocale() |
||
| 22 | { |
||
| 23 | return $this->locale ?: i18n::get_locale(); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Determines the presented/processed format based on locale defaults, |
||
| 28 | * instead of explicitly setting {@link setDateFormat()}. |
||
| 29 | * Only applicable with {@link setHTML5(false)}. |
||
| 30 | * |
||
| 31 | * @param string $locale |
||
| 32 | * @return $this |
||
| 33 | */ |
||
| 34 | public function setLocale($locale) |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function getScriptDir() |
||
| 48 |