diff --git a/client/src/components/UserTable.js b/client/src/components/UserTable.js index 44c14b1..3ed47d8 100644 --- a/client/src/components/UserTable.js +++ b/client/src/components/UserTable.js @@ -1,9 +1,10 @@ import React from 'react' import { Table } from 'semantic-ui-react' -import moment from 'moment/min/moment-with-locales'; +import moment from "moment"; +import trLocale from "moment/locale/tr"; export default function UserTable({ user: { id, name, email, role, createdAt } }) { - moment.locale('tr'); + moment.locale('tr', [trLocale]) return ( diff --git a/util/validators.js b/util/validators.js index df58f5a..dd117eb 100644 --- a/util/validators.js +++ b/util/validators.js @@ -8,7 +8,7 @@ module.exports.validateCreateInput = ( const errors = {}; const emailRegEx = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/; - const eduRegEx = /[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])+@[0-9a-zA-Z][-\w]*[0-9a-zA-Z]+\.edu\.[a-zA-Z]+/i; + const eduRegEx = /^\.edu\.(?!\s)[a-zA-Z]|\.edu(?!\s)+/; const isValidEmail = email.match(emailRegEx); const isEduEmail = email.match(eduRegEx); const isAcademic = role.trim() === 'öğrenci' || role.trim() === 'görevli';