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

Commit

Permalink
Merge pull request #2114 from bbc/override-moment-formats
Browse files Browse the repository at this point in the history
Override moment formats
  • Loading branch information
DenisHdz authored Sep 16, 2019
2 parents 27ed471 + 6266cad commit 095f49d
Show file tree
Hide file tree
Showing 19 changed files with 2,788 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/utilities/psammead-locales/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------- | ----------- |
| 2.7.0 | [PR#2114](https://github.com/bbc/psammead/pull/2114) Add some overrides for Brasil, Russian, Serbian and Ukrainian |
| 2.6.0 | [PR#2124](https://github.com/bbc/psammead/pull/2124) Add `ta` (Tamil) locale |
| 2.5.0 | [PR#2118](https://github.com/bbc/psammead/pull/2118) Add `mr` (Marathi) locale |
| 2.4.0 | [PR#2110](https://github.com/bbc/psammead/pull/2110) Add `hi` (Hindi) locale |
Expand Down
5 changes: 5 additions & 0 deletions packages/utilities/psammead-locales/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The following locales have overrides to meet BBC World Service requirements wher

- `/moment/ar` - locale override for Arabic
- `/moment/fa` - locale override for Persian (Farsi)
- `/moment/pt-br` - locale override for Brasil
- `/moment/ru` - locale override for Russian
- `/moment/sr` - locale override for Serbian
- `/moment/sr-cyrl` - locale override for Serbian Cyrillic
- `/moment/uk` - locale override for Ukrainian
- `/moment/yo` - locale override for Yoruba
- `/moment/ta` - locale override for Tamil
- `/moment/mr` - locale override for Marathi
Expand Down
24 changes: 17 additions & 7 deletions packages/utilities/psammead-locales/moment/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,38 @@ import { GEL_FF_REITH_SANS } from '@bbc/gel-foundations/typography';
import notes from '../README.md';
import './ar';
import './fa';
import './hi';
import './ig';
import './mr';
import './pa-in';
import './pcm';
import './ps';
import './yo';
import './pa-in';
import './pt-br';
import './ru';
import './sr';
import './sr-cyrl';
import './ta';
import './mr';
import './hi';
import './uk';
import './yo';

const stories = storiesOf('Utilities|Psammead Locales', module);

const locales = [
{ name: 'Arabic', locale: 'ar' },
{ name: 'Brasil', locale: 'pt-br' },
{ name: 'Hindi', locale: 'hi' },
{ name: 'Igbo', locale: 'ig' },
{ name: 'Marathi', locale: 'mr' },
{ name: 'Pashto', locale: 'ps' },
{ name: 'Persian', locale: 'fa' },
{ name: 'Pidgin', locale: 'pcm' },
{ name: 'Yoruba', locale: 'yo' },
{ name: 'Punjabi', locale: 'pa-in' },
{ name: 'Russian', locale: 'ru' },
{ name: 'Serbian', locale: 'sr' },
{ name: 'Serbian Cyrillic', locale: 'sr-cyrl' },
{ name: 'Tamil', locale: 'ta' },
{ name: 'Marathi', locale: 'mr' },
{ name: 'Hindi', locale: 'hi' },
{ name: 'Ukrainian', locale: 'uk' },
{ name: 'Yoruba', locale: 'yo' },
];

// Fixed timestamp for 27 August 2019, 14:54 BST
Expand Down
10 changes: 10 additions & 0 deletions packages/utilities/psammead-locales/moment/pt-br.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var moment = require('moment');
require('moment/locale/pt-br');

moment.updateLocale('pt-br', {
longDateFormat: {
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [às] HH:mm',
LLLL: 'dddd, D MMMM YYYY [às] HH:mm',
},
});
Loading

0 comments on commit 095f49d

Please sign in to comment.