Skip to content

Commit 568ad1e

Browse files
fix deprecation logic #2
1 parent d154e44 commit 568ad1e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/components/models/ModelBadges.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const ModelBadges = ({ model }: { model: WorkersAIModelsSchema }) => {
3838
}
3939

4040
if (property_id === "planned_deprecation_date") {
41-
const timestamp = Math.floor(new Date(value as string).getTime() / 1000);
41+
const timestamp = Math.floor(new Date(value as string).getTime());
4242

4343
if (Date.now() > timestamp) {
4444
return { variant: "danger", text: "Deprecated" };

src/components/models/ModelFeatures.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ const ModelFeatures = ({ model }: { model: WorkersAIModelsSchema }) => {
2929
{properties.planned_deprecation_date && (
3030
<tr>
3131
<td>
32-
{Date.now() <
33-
Math.floor(
34-
new Date(properties.planned_deprecation_date).getTime() /
35-
1000,
36-
)
32+
{Date.now() >
33+
Math.floor(new Date(properties.planned_deprecation_date).getTime())
3734
? "Deprecated"
3835
: "Planned Deprecation"}
3936
</td>

0 commit comments

Comments
 (0)