Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating how date/time is being displayed on notes & fixing some TS i… #646

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions app/components/assets/custom-fields-inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,8 @@ export default function AssetCustomFields({
defaultValue={val ? val : field.required ? field.options[0] : ""}
disabled={disabled}
>
<SelectTrigger
className="px-3.5 py-3"
placeholder={`Choose ${field.name}`}
>
<SelectValue />
<SelectTrigger className="px-3.5 py-3">
<SelectValue placeholder={`Choose ${field.name}`} />
</SelectTrigger>
<SelectContent
position="popper"
Expand Down
8 changes: 2 additions & 6 deletions app/components/custom-fields/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,8 @@ export const CustomFieldForm = ({
disabled={disabled}
onValueChange={(val: CustomFieldType) => setSelectedType(val)}
>
<SelectTrigger
disabled={isEdit}
className="px-3.5 py-3"
placeholder="Choose a field type"
>
<SelectValue />
<SelectTrigger disabled={isEdit} className="px-3.5 py-3">
<SelectValue placeholder="Choose a field type" />
</SelectTrigger>
<SelectContent
position="popper"
Expand Down
7 changes: 2 additions & 5 deletions app/components/workspace/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,8 @@ export const WorkspaceForm = ({ name, currency }: Props) => {
disabled={disabled}
name={zo.fields.currency()}
>
<SelectTrigger
className="px-3.5 py-3"
placeholder="Choose a field type"
>
<SelectValue />
<SelectTrigger className="px-3.5 py-3">
<SelectValue placeholder="Choose a field type" />
</SelectTrigger>
<SelectContent
position="popper"
Expand Down
10 changes: 8 additions & 2 deletions app/routes/_layout+/assets.$assetId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,20 @@ export async function loader({ request, params }: LoaderFunctionArgs) {

const notes = asset.notes.map((note) => ({
...note,
dateDisplay: getDateTimeFormat(request).format(note.createdAt),
dateDisplay: getDateTimeFormat(request, {
dateStyle: "short",
timeStyle: "short",
}).format(note.createdAt),
content: parseMarkdownToReact(note.content),
}));

let custody = null;
if (asset.custody) {
const date = new Date(asset.custody.createdAt);
const dateDisplay = getDateTimeFormat(request).format(date);
const dateDisplay = getDateTimeFormat(request, {
dateStyle: "short",
timeStyle: "short",
}).format(date);

custody = {
...asset.custody,
Expand Down
7 changes: 2 additions & 5 deletions app/routes/_layout+/settings.general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,8 @@ export default function GeneralPage() {
disabled={disabled}
name={zo.fields.currency()}
>
<SelectTrigger
className="px-3.5 py-3"
placeholder="Choose a field type"
>
<SelectValue />
<SelectTrigger className="px-3.5 py-3">
<SelectValue placeholder="Choose a field type" />
</SelectTrigger>
<SelectContent
position="popper"
Expand Down
3 changes: 1 addition & 2 deletions app/utils/client-hints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ export function getDateTimeFormat(
};

options = {
...defaultOptions,
...options,
...(options || defaultOptions),
timeZone: options?.timeZone ?? getHints(request).timeZone,
};
return new Intl.DateTimeFormat(locale, options);
Expand Down
Loading
Loading