Commit 51244e52 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Improve McpdDate component

parent 1a6b94d9
Pipeline #6834 passed with stages
in 6 minutes and 20 seconds
import * as React from 'react';
import Validators from 'utilities/Validators';
export default function McpdDate({ value, locale = 'en-GB' }: { value: string, locale?: string }) {
......@@ -7,6 +8,10 @@ export default function McpdDate({ value, locale = 'en-GB' }: { value: string, l
return (<i>Date not provided</i>);
}
if (Validators.mcpdDate(value) === 'Invalid date') {
return <span>{ value }</span>;
}
const year = value.substr(0, 4);
const month = value.substr(4, 2);
const day = value.substr(6, 2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment