Skip to content

Commit

Permalink
Merge pull request #365 from shesha-io/feat/ps/date-formating-with-pr…
Browse files Browse the repository at this point in the history
…efix-regex

Fix : date formating with prefix regex
  • Loading branch information
pholoshos committed Jul 6, 2023
2 parents f5976d2 + 6557ea9 commit fb16a2e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export const getContent = (content: string, { dataType = 'string', dateFormat, n
};

export const formatDateStringAndPrefix = (content: string, dateFormat: string) => {
const regex = /^\s*(\S+)?\s*(\d{4}-\d{2}-\d{2})/;
const regex = /^\s*([\S\s]+?)\s+(\d{4}-\d{2}-\d{2})/;
const match = content.match(regex);

if (match && match.length > 2) {
if (match) {
const prefix = match[1] || '';
const dateString = match[2];

Expand Down

0 comments on commit fb16a2e

Please sign in to comment.