Skip to content

Commit

Permalink
feat: field.type = date
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed May 14, 2022
1 parent 50efccd commit 171a038
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,13 @@ export default {
}
}
if (field.type === 'date') {
const d = new Date(valueText);
valueText = d.toISOString();
valueText = valueText.replace('T', ' ').replace(/\..*/, '')
if (d.getTime() == 0) valueText = '-';
}
if (field.type === 'email' && valueText) {
valueText = `<a href="mailto:${valueText}" target="_blank">${valueText}</a>`;
}
Expand Down

0 comments on commit 171a038

Please sign in to comment.