Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from eea/develop
Browse files Browse the repository at this point in the history
Consider dateLocale config.
  • Loading branch information
avoinea authored Oct 19, 2021
2 parents 2f5ac4f + bbceb3a commit 70f3ec7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
19 changes: 8 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [3.0.0](https://github.com/eea/volto-widgets-view/compare/2.1.2...3.0.0)
#### [3.0.1](https://github.com/eea/volto-widgets-view/compare/3.0.0...3.0.1)

- Add date locale config settings [`f425e19`](https://github.com/eea/volto-widgets-view/commit/f425e1980697f519cd8b0a26ae6945fbcbfc821d)

### [3.0.0](https://github.com/eea/volto-widgets-view/compare/2.1.2...3.0.0)

> 3 September 2021
- Release [`#5`](https://github.com/eea/volto-widgets-view/pull/5)
- Code cleanup [`2becdc5`](https://github.com/eea/volto-widgets-view/commit/2becdc5a196edaa9db8d1741cd7752fdac39013f)
- Release 3.0.0 [`95a63b3`](https://github.com/eea/volto-widgets-view/commit/95a63b3745100fe1bf59bf6e63258554d2685239)
- Fix config.widgets.views in order to be able to register views from other add-ons [`1c01da9`](https://github.com/eea/volto-widgets-view/commit/1c01da963a43339422019ab2a07ec46db1abed82)
- Add Sonarqube tag using frontend addons list [`8274ffb`](https://github.com/eea/volto-widgets-view/commit/8274ffb7e96066c21680b2addfcd131a52aaa461)
- Add Sonarqube tag using frontend addons list [`852108b`](https://github.com/eea/volto-widgets-view/commit/852108bf32a2e16e0f1212f993a2c467ada89a69)

#### [2.1.2](https://github.com/eea/volto-widgets-view/compare/2.1.1...2.1.2)

Expand All @@ -22,14 +27,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 14 May 2021
- [JENKINS] - Auto-release pipeline [`#3`](https://github.com/eea/volto-widgets-view/pull/3)

#### [2.1.0](https://github.com/eea/volto-widgets-view/compare/2.0.0...2.1.0)

> 8 March 2021
- Release 2.1.0 [`42f8b4a`](https://github.com/eea/volto-widgets-view/commit/42f8b4a9a557946e95ae19256cb3dc588c349078)
- Cleanup DEPENDENCIES from Jenkinsfile [`b4cb8e7`](https://github.com/eea/volto-widgets-view/commit/b4cb8e7e4749c393f7d6e92265bb4afe25b3402b)

### [2.0.0](https://github.com/eea/volto-widgets-view/compare/1.0.3...2.0.0)

Expand All @@ -52,8 +55,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Release 1.0.2 [`23784c6`](https://github.com/eea/volto-widgets-view/commit/23784c62990d544daf08cf46cca24c43c116498c)
- Auto release npm [`3aca979`](https://github.com/eea/volto-widgets-view/commit/3aca979d10374464376e012af775ae265c3ad2d7)
- [JENKINS] - Fix SONAR tags [`dbaa989`](https://github.com/eea/volto-widgets-view/commit/dbaa98951b0414b9cb73c99bd5e94d20142f3e73)
- [JENKINS] - Update docs [`be258be`](https://github.com/eea/volto-widgets-view/commit/be258bebee474a8145c745bf509a160028c3abec)
- set sonar.coverage.exclusions [`d206559`](https://github.com/eea/volto-widgets-view/commit/d206559918d46b898d7eb8d6e94df50410cfdd51)
- add exclude scan tests [`17eaaea`](https://github.com/eea/volto-widgets-view/commit/17eaaeaeaeaa6bf41346af5a8fa49de15df892fb)
- add sed in coverage report [`ae386cf`](https://github.com/eea/volto-widgets-view/commit/ae386cf3d62c4a8e7d14637708be340530915e6c)
Expand All @@ -64,12 +65,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- set unstash in pwd [`0d453c1`](https://github.com/eea/volto-widgets-view/commit/0d453c1c372d35820b99a1b82359583907f74ba9)
- add sed paths in lcov.info [`0575431`](https://github.com/eea/volto-widgets-view/commit/05754315c4cec096357ad2bc6ad78d3f16957651)
- view junit.xml [`3b12409`](https://github.com/eea/volto-widgets-view/commit/3b124092097d175e2c7955a5fff543b7a9535fd1)
- Update Jenkinsfile [`9393bba`](https://github.com/eea/volto-widgets-view/commit/9393bbaf82b0e7e65f1738adb925a22f912ba2aa)
- add junit.txt debug location [`9f9a564`](https://github.com/eea/volto-widgets-view/commit/9f9a564323b742f0d904a27e438d02b886bfdfd2)
- add debug [`a71a5f3`](https://github.com/eea/volto-widgets-view/commit/a71a5f3882a869d48a62c40a642737a1eb4c81a2)
- [JENKINS] - Fix code-analysis [`7ef72d1`](https://github.com/eea/volto-widgets-view/commit/7ef72d1fe5392c3d1478c629ed8d48c406ca1d0a)
- [JENKINS] - Add Jenkins pipeline [`f85b348`](https://github.com/eea/volto-widgets-view/commit/f85b3482aba96fd2942afad11ae3051d806df738)
- [JENKINS] - yarn prettier [`898eecf`](https://github.com/eea/volto-widgets-view/commit/898eecf219ffca8a09b431c0439c33d92cbe7de9)

#### [1.0.1](https://github.com/eea/volto-widgets-view/compare/1.0.0...1.0.1)

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
environment {
GIT_NAME = "volto-widgets-view"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,clms.land.copernicus.eu"
DEPENDENCIES = ""
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-widgets-view",
"version": "3.0.0",
"version": "3.0.1",
"description": "Volto Widgets in View mode",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
7 changes: 5 additions & 2 deletions src/components/theme/Widgets/DateWidget.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from 'react';
import cx from 'classnames';
import moment from 'moment';
import config from '@plone/volto/registry';

export const DateWidget = ({ value, children, className }) =>
value ? (
export const DateWidget = ({ value, children, className }) => {
moment.locale(config.settings.dateLocale);
return value ? (
<span className={cx(className, 'date', 'widget')}>
{children
? children(moment(value).format('ll'))
Expand All @@ -12,3 +14,4 @@ export const DateWidget = ({ value, children, className }) =>
) : (
''
);
};
7 changes: 5 additions & 2 deletions src/components/theme/Widgets/DatetimeWidget.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from 'react';
import cx from 'classnames';
import moment from 'moment';
import config from '@plone/volto/registry';

export const DatetimeWidget = ({ value, children, className }) =>
value ? (
export const DatetimeWidget = ({ value, children, className }) => {
moment.locale(config.settings.dateLocale);
return value ? (
<span className={cx(className, 'datetime', 'widget')}>
{children
? children(moment(value).format('lll'))
Expand All @@ -12,3 +14,4 @@ export const DatetimeWidget = ({ value, children, className }) =>
) : (
''
);
};
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const applyConfig = (config) => {
},
};

// moment date locale. See https://momentjs.com/ - Multiple Locale Support
config.settings.dateLocale = config.settings.dateLocale || 'en';

return config;
};

Expand Down

0 comments on commit 70f3ec7

Please sign in to comment.