Skip to content

Commit

Permalink
trim price date in table
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDuluoz committed Feb 14, 2023
1 parent f5fa4c1 commit 4dba70a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/components/admin/PropertyPrices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export default function PropertyPrices() {
console.log(error);
});
}

const trimSqlDate = (date) => {
return date.split('').splice(0, 10).join('')
}

let tableProperties
(properties && prices) && (tableProperties = properties.map((property) => {
Expand All @@ -70,6 +74,7 @@ export default function PropertyPrices() {
if (price.property_id === propertyId) {
const newPrice = {
...price,
date: trimSqlDate(price.date),
priceDel: <Button label="Delete" className="p-button-danger" onClick={() => priceDelete(newPrice.id)} />
}
propertyPriceArray.push(newPrice)
Expand Down

0 comments on commit 4dba70a

Please sign in to comment.