Merge branch 'dev' into host
This commit is contained in:
@@ -121,10 +121,28 @@ export const MyLoansPage = () => {
|
||||
|
||||
const formatDate = (iso: string | null) => {
|
||||
if (!iso) return "-";
|
||||
const m = iso.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);
|
||||
if (!m) return iso;
|
||||
const [, y, M, d, h, min] = m;
|
||||
return `${d}.${M}.${y} ${h}:${min}`;
|
||||
const date = new Date(iso);
|
||||
if (isNaN(date.getTime())) return iso;
|
||||
return date.toLocaleString("de-DE", {
|
||||
timeZone: "Europe/Berlin",
|
||||
day: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
};
|
||||
|
||||
const dateAndTime = (isISO: boolean) => {
|
||||
const date = new Date();
|
||||
|
||||
if (isISO) {
|
||||
return date.toISOString();
|
||||
}
|
||||
|
||||
if (!isISO) {
|
||||
return date;
|
||||
}
|
||||
};
|
||||
|
||||
const handleTakeAction = async (loanCode: string) => {
|
||||
@@ -151,7 +169,7 @@ export const MyLoansPage = () => {
|
||||
setLoans((prev) =>
|
||||
prev.map((loan) =>
|
||||
loan.loan_code === loanCode
|
||||
? { ...loan, take_date: new Date().toISOString() }
|
||||
? { ...loan, take_date: dateAndTime(true) }
|
||||
: loan,
|
||||
),
|
||||
);
|
||||
@@ -191,7 +209,7 @@ export const MyLoansPage = () => {
|
||||
setLoans((prev) =>
|
||||
prev.map((loan) =>
|
||||
loan.loan_code === loanCode
|
||||
? { ...loan, returned_date: new Date().toISOString() }
|
||||
? { ...loan, returned_date: dateAndTime(true) }
|
||||
: loan,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"sure-delete-loan-2": "Für den Admin bleibt sie weiterhin sichtbar.",
|
||||
"delete": "Löschen",
|
||||
"change-language": "Sprache ändern",
|
||||
"timezone-info": "Die angezeigten Daten und Uhrzeiten werden in deutscher Zeitzone dargestellt und müssen auch so eingegeben werden.",
|
||||
"timezone-info": "Die angezeigten Daten und Uhrzeiten werden in deutscher Zeitzone dargestellt und müssen auch so eingegeben werden. Das gesamte System ist auf die deutsche Zeitzone eingestellt.",
|
||||
"optional-note": "Optionale Notiz",
|
||||
"note": "Notiz",
|
||||
"user-info-desc": "Hier können Sie Ihre persönlichen Informationen einsehen und das Passwort ändern. Falls Sie weitere Änderungen benötigen, wenden Sie sich bitte an einen Administrator.",
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"sure-delete-loan-2": "It will remain visible to the admin.",
|
||||
"delete": "Delete",
|
||||
"change-language": "Change language",
|
||||
"timezone-info": "The displayed dates and times are shown in Berlin timezone and must also be entered as such.",
|
||||
"timezone-info": "The displayed dates and times are shown in Berlin timezone and must also be entered as such. The entire system is set to Berlin timezone.",
|
||||
"optional-note": "Optional note",
|
||||
"note": "Note",
|
||||
"user-info-desc": "Here you can view your personal information and change your password. If you need to make further changes, please contact an administrator.",
|
||||
|
||||
+8
-17
@@ -1,37 +1,28 @@
|
||||
# Changelog for upcoming version: v2.2
|
||||
# Changelog for upcoming version: vX.X
|
||||
|
||||
This update provides some new features for the design. It also contains some improvements and I have also fixed some bugs.
|
||||
Introduction
|
||||
|
||||
## New features
|
||||
|
||||
- **Deactivatable services:** I have added the ability to deactivate services, which can be useful for maintenance or other purposes. The admin can activate and deactivate services in the admin panel. If a service is deactivated, it will not be available for users and they will get an error message if they try to use it. They will also get an warning banner on the homepage.
|
||||
- **New Animations:** I have added some new animations to the frontend, which make the user experience more enjoyable.
|
||||
- **New Icon:** I have added a new icon for the frontend, which is now also used in the header and the favicon. It is a dark version of the old icon, which fits better to the overall design. I have made it with Icon Composer. The old icon is still used for the admin panel, which has a light design. (Maybe I will change the admin panel design in the future...)
|
||||
- **New Button:** When you go to your user card (over the user icon in the header) you have a new button "Click me". If you click it, you will get an message... _I am just saying: I have implemented the no-as-a-service code in to my Backend._
|
||||
-
|
||||
|
||||
## Improvements
|
||||
|
||||
- The overview page now shows the note column and is overall better organised.
|
||||
- Improved error logging
|
||||
- If you try to delete a loan that has not been returned yet, you will get an 507 error code.
|
||||
- When the admin deletes a loan, the loan will be still visible in the database, but it will be marked as deleted. This is to prevent data loss and to keep track of deleted loans.
|
||||
- Mailer improvements: The mailer is now more clearly organised. Two large code files are now split into five smaller code files which are easier to maintain. Also the design of the mails has improved.
|
||||
-
|
||||
|
||||
## Fixed bugs
|
||||
|
||||
- Fixed bug: #13
|
||||
- Fixed bug for messaging when server has an error
|
||||
- Fixed footer height
|
||||
-
|
||||
|
||||
---
|
||||
|
||||
## New version numbers
|
||||
|
||||
**Backend:** v2.2
|
||||
**Backend:** vX.X
|
||||
|
||||
**Frontend:** v2.2
|
||||
**Frontend:** vX.X
|
||||
|
||||
**Admin panel:** v1.4
|
||||
**Admin panel:** vX.X
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user