Skip to content

Commit

Permalink
fix: remove capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
HellWolf93 committed Sep 17, 2021
1 parent 70dcb21 commit 35079e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.

This file was deleted.

7 changes: 1 addition & 6 deletions src/components/DateTimePicker/helpers/formatDateTime.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import capitalizeFirstLetter from './capitalizeFirstLetter';

/* eslint-disable no-console */
const FORMATS = {
small: { year: '2-digit', month: 'numeric', day: 'numeric' },
Expand All @@ -20,13 +18,10 @@ export default function formatDateTime(
const options = FORMATS[formatStyle] || FORMATS.medium;
const value = typeof date === 'string' ? new Date(date) : date;
const timeFormat = hour24 ? timeFormat24h : timeFormat12h;
const formattedDatetime = new Intl.DateTimeFormat(locale, {
return new Intl.DateTimeFormat(locale, {
...options,
...timeFormat,
}).format(value);
return formatStyle === 'large'
? capitalizeFirstLetter(formattedDatetime)
: formattedDatetime;
} catch (error) {
console.error(error);
return '';
Expand Down

0 comments on commit 35079e6

Please sign in to comment.