import{j as t}from"./index-bIIEL2MP.js";import{useMDXComponents as i}from"./index-CO-0pc0F.js";import{M as o}from"./index-Z-6k0Xrj.js";import{U as s}from"./Utils.stories-BtMkLmNg.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iframe-CzjIX-qr.js";import"./index-aQYXhgXp.js";import"./index-DrFu-skq.js";import"./props-b4vEeO_8.js";import"./runtime-C3rQLW--.js";import"./lifecycle-F2p_Qkk3.js";import"./create-runtime-stories-7AWWVphH.js";import"./snippet-C5kbqVpq.js";import"./svelte-component-C8Ginrj8.js";import"./get-C3XmtPLd.js";function r(n){const e={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...i(),...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(o,{of:s}),` `,t.jsx(e.h1,{id:"util-functions",children:"Util functions"}),` `,t.jsx(e.p,{children:"This library provides utility functions that can be used across various components and applications."}),` `,t.jsx(e.h2,{id:"prettify-date-in-the-reuters-format",children:"Prettify date in the Reuters format"}),` `,t.jsxs(e.p,{children:["The function ",t.jsx(e.code,{children:"prettifyDate"})," formats the input string, which is expected to be in English, to format the month and time designator (AM/PM) according to the Reuters style guide. The function is case agnostic and will format both full month names and their 3-letter abbreviations (i.e. ",t.jsx(e.code,{children:"Mar"})," or ",t.jsx(e.code,{children:"Jun"}),") correctly."]}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`import { prettifyDate } from '@reuters-graphics/graphics-components'; // Example usage prettifyDate('January 1, 2023, 10:00 AM'); // returns 'Jan. 1, 2023, 10:00 a.m.' prettifyDate('Jan 1, 2023, 10:00 PM'); // returns 'Jan. 1, 2023, 10:00 p.m.' prettifyDate('MAR. 2025'); // returns 'March 2025' prettifyDate('sep. 1, 2023, 10:00PM'); // returns 'Sept. 1, 2023, 10:00 p.m.' `})})]})}function b(n={}){const{wrapper:e}={...i(),...n.components};return e?t.jsx(e,{...n,children:t.jsx(r,{...n})}):r(n)}export{b as default};