@reuters-graphics/graphics-components 3.0.15 → 3.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,6 +88,15 @@ describe('Utils tests', () => {
88
88
  const unformattedSept = 'Sep. 2025';
89
89
  const formattedSept = 'Sept. 2025';
90
90
  expect(prettifyDate(unformattedSept)).toBe(formattedSept);
91
+ const unformattedOct = 'Oct. 2025';
92
+ const formattedOct = 'Oct. 2025';
93
+ expect(prettifyDate(unformattedOct)).toBe(formattedOct);
94
+ const unformattedNov = 'Nov 2025';
95
+ const formattedNov = 'Nov. 2025';
96
+ expect(prettifyDate(unformattedNov)).toBe(formattedNov);
97
+ const unformattedDec = 'DEC 2025';
98
+ const formattedDec = 'Dec. 2025';
99
+ expect(prettifyDate(unformattedDec)).toBe(formattedDec);
91
100
  });
92
101
  it('should fix spacing between time and am/pm', () => {
93
102
  const unformattedMarch = 'Mar. 1, 2023, 10:00pm';
@@ -102,9 +111,15 @@ describe('Utils tests', () => {
102
111
  const unformattedJune = 'Jun. 1, 2023, 10:00AM';
103
112
  const formattedJune = 'June 1, 2023, 10:00 a.m.';
104
113
  expect(prettifyDate(unformattedJune)).toBe(formattedJune);
114
+ const unformattedAug = 'aug 1, 2023, 10:00PM';
115
+ const formattedAug = 'Aug. 1, 2023, 10:00 p.m.';
116
+ expect(prettifyDate(unformattedAug)).toBe(formattedAug);
105
117
  const unformattedSept = 'sep. 1, 2023, 10:00PM';
106
118
  const formattedSept = 'Sept. 1, 2023, 10:00 p.m.';
107
119
  expect(prettifyDate(unformattedSept)).toBe(formattedSept);
120
+ const unformattedOct = 'oct 1, 2023, 10:00PM';
121
+ const formattedOct = 'Oct. 1, 2023, 10:00 p.m.';
122
+ expect(prettifyDate(unformattedOct)).toBe(formattedOct);
108
123
  });
109
124
  it('should work with lower or upper case', () => {
110
125
  const unformattedMarch = 'MAR. 1, 2023, 10:00pm';
@@ -119,5 +134,8 @@ describe('Utils tests', () => {
119
134
  const unformattedJune = 'JUN. 1, 2023, 10:00AM';
120
135
  const formattedJune = 'June 1, 2023, 10:00 a.m.';
121
136
  expect(prettifyDate(unformattedJune)).toBe(formattedJune);
137
+ const unformattedAug = 'AUG. 1, 2023, 10:00PM';
138
+ const formattedAug = 'Aug. 1, 2023, 10:00 p.m.';
139
+ expect(prettifyDate(unformattedAug)).toBe(formattedAug);
122
140
  });
123
141
  });
@@ -47,7 +47,11 @@ export const prettifyDate = (input) => {
47
47
  apr: 'April',
48
48
  jun: 'June',
49
49
  jul: 'July',
50
+ aug: 'Aug.',
50
51
  sep: 'Sept.',
52
+ oct: 'Oct.',
53
+ nov: 'Nov.',
54
+ dec: 'Dec.',
51
55
  };
52
56
  // If the key in conversions is found in the input (case insensitive), replace it with the corresponding value
53
57
  const formatted = Object.keys(conversions).reduce((acc, key) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "3.0.15",
3
+ "version": "3.0.16",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",