The Australian Government coat of Arms

Communities of practice

Date formatters


#1

Moved from: https://github.com/govau/uikit/issues/181

In addition to Content Guide recommended dates referenced here https://github.com/govau/uikit/issues/180, Performance Dashboards Team would like these added:

const dashboardDateFormats = {
	dateTime: `2017-05-10T04:10:19.198Z`, // used in `<time datetime="">`
	dayMonthYear: `1 Feb 2017`,
	monthShortyear: `Feb '17`,
	monthYear: 'Feb 2017',
};

Iteration 1:

const dateFormats = {
        dayMonthYear: 'Tuesday 8 October 2016',
	century: '19th century',
	rangeDayToDay: 'Monday to Friday',
	rangeTimeToTime: '9am to 5pm',
	hours: '9am',
	hoursMinutes: '9:30am',
	hoursMinutes24Hour: '19:45',
	humanisedHoursMinutes: '9 hours and 15 minutes'
};

#2

Google are doing this well - https://material.io/guidelines/patterns/data-formats.html#

Space for an Aust version that we can adopt based on Content Guides.


#3

This is not really a component.

Are there any plans for design system having utilities and recommended patterns?


#4

Yeah definitely, you can already see some utilities in the animate component. I am not sure how far down the utility path we are going to go however I can understand that this is quite a simple utility.


#5

I like IMDb.com’s shortened date format for running time - 1h 44min - which would be useful for us to adopt in audio and video file links