style: new empty states (#1497)

* fix: custom colors opacity

* chore: update text colors for dark mode

* fix: dropdown text colors, datepicker bg color

* chore: update text colors

* chore: updated primary bg color

* style: new empty states added

* refactor: empty state for issues

* style: empty state for estimates

* chore: update labels, estimates and integrations empty states

* fix: custom analytics sidebar
This commit is contained in:
Aaryan Khandelwal 2023-07-12 11:45:45 +05:30 committed by GitHub
parent 82ff786666
commit 4a2057c0b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 757 additions and 792 deletions

View file

@ -172,18 +172,35 @@ export const renderShortDate = (date: string | Date, placeholder?: string) => {
return isNaN(date.getTime()) ? placeholder ?? "N/A" : `${day} ${month}`;
};
export const renderShortTime = (date: string | Date) => {
if (!date || date === "") return null;
export const render12HourFormatTime = (date: string | Date): string => {
if (!date || date === "") return "";
date = new Date(date);
let hours = date.getHours();
const minutes = date.getMinutes();
let period = "AM";
if (hours >= 12) {
period = "PM";
if (hours > 12) hours -= 12;
}
return hours + ":" + minutes + " " + period;
};
export const render24HourFormatTime = (date: string | Date): string => {
if (!date || date === "") return "";
date = new Date(date);
const hours = date.getHours();
let minutes: any = date.getMinutes();
// Add leading zero to single-digit minutes
if (minutes < 10) {
minutes = "0" + minutes;
}
// add leading zero to single digit minutes
if (minutes < 10) minutes = "0" + minutes;
return hours + ":" + minutes;
};