-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes date field validation message presents in reverse order (#72)
* Added UK short date format * Amended unit webform element test to load deault configuraion * Amended webform element unit test to load default localgov forms date configuration * Applied coding standard fixes * Amended the date formats namespace to include localgov_forms * Corrected namespace * Removed html from the name --------- Co-authored-by: Matt Ozogolu <2003150@croydongov.uk>
- Loading branch information
1 parent
b9d8ce4
commit e092414
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
modules/localgov_forms_date/config/install/core.date_format.localgov_forms_date_datetime.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
langcode: en | ||
status: true | ||
dependencies: { } | ||
id: localgov_forms_date_datetime | ||
label: 'LocalGOV Forms Datetime' | ||
locked: false | ||
pattern: 'd-m-Y\TH:i:sO' |
7 changes: 7 additions & 0 deletions
7
...es/localgov_forms_date/config/install/core.date_format.localgov_forms_date_short_date.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
langcode: en | ||
status: true | ||
dependencies: { } | ||
id: localgov_forms_date_short_date | ||
label: 'LocalGOV Forms Short Date' | ||
locked: false | ||
pattern: d-m-Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Install, update and uninstall functions for the LocalGov Forms Date module. | ||
*/ | ||
|
||
use Drupal\Component\Serialization\Yaml; | ||
|
||
/** | ||
* Adds a UK short date style e.g dd-mm-yyyy. | ||
*/ | ||
function localgov_forms_date_update_8001() { | ||
$config_id = 'core.date_format.localgov_forms_date_short_date'; | ||
$config_path = \Drupal::service('extension.list.module')->getPath('localgov_forms_date'); | ||
$uk_short_html_date_config = Yaml::decode(file_get_contents($config_path . '/config/install/' . $config_id . '.yml')); | ||
\Drupal::configFactory()->getEditable($config_id)->setData($uk_short_html_date_config)->save(); | ||
} | ||
|
||
/** | ||
* Adds a UK short date style e.g dd-mm-yyyy HH:mm:ss. | ||
*/ | ||
function localgov_forms_date_update_8002() { | ||
$config_id = 'core.date_format.localgov_forms_date_datetime'; | ||
$config_path = \Drupal::service('extension.list.module')->getPath('localgov_forms_date'); | ||
$uk_html_datetime_config = Yaml::decode(file_get_contents($config_path . '/config/install/' . $config_id . '.yml')); | ||
\Drupal::configFactory()->getEditable($config_id)->setData($uk_html_datetime_config)->save(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters