Skip to content

Commit

Permalink
BC-7000 - fix date function (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
virgilchiriac authored and wolfganggreschus committed Apr 3, 2024
1 parent e482c6e commit a6b2607
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plugins/datetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ export const inputDateFormat = (date) => {
* @return {String} Date string based on current timezone using locale date formating
*/
export const printDate = (date) => {
return fromUTC(date).format(DATETIME_FORMAT.date);
if (date) {
const result = fromUTC(date).format(DATETIME_FORMAT.date);
return result;
}
return null;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/store/bulkConsent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import generatePassword from "@/mixins/generatePassword";
import { $axios } from "@/utils/api";
import { inputDateFormat } from "@/plugins/datetime";

export const actions = {
/**
Expand Down Expand Up @@ -77,6 +78,7 @@ export const actions = {
.map((student) => {
student.fullName = student.firstName + " " + student.lastName;
student.password = generatePassword();
student.birthday = inputDateFormat(student.birthday);
return student;
});
commit("setStudentsData", data);
Expand Down

0 comments on commit a6b2607

Please sign in to comment.