change task lists created at column to use timestamp

Signed-off-by: Stephen Glass <stephen@stephen.glass>
This commit is contained in:
Stephen Glass
2024-09-18 21:57:38 -04:00
parent 7b8446a5e1
commit 46986466fe
2 changed files with 10 additions and 10 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Change task list created at column to show timestamp
@@ -13,20 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DateTime, Interval } from 'luxon';
import humanizeDuration from 'humanize-duration';
import { DateTime } from 'luxon';
import React from 'react';
import Typography from '@material-ui/core/Typography';
export const CreatedAtColumn = ({ createdAt }: { createdAt: string }) => {
const createdAtTime = DateTime.fromISO(createdAt);
const formatted = Interval.fromDateTimes(createdAtTime, DateTime.local())
.toDuration()
.valueOf();
return (
<Typography paragraph>
{humanizeDuration(formatted, { round: true })} ago
</Typography>
const formatted = createdAtTime.toLocaleString(
DateTime.DATETIME_SHORT_WITH_SECONDS,
);
return <Typography paragraph>{formatted}</Typography>;
};