Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
date: Fix %Z output
Browse files Browse the repository at this point in the history
This was outputting the entire date with timezone, instead of just the
timezone.
  • Loading branch information
AtkinsSJ committed Apr 1, 2024
1 parent 28750bc commit c84a12e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/puter-shell/coreutils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ export default {

// "Timezone name, or no characters if no timezone is determinable."
case 'Z': {
output += date.toLocaleDateString(locale, { timeZone: timeZone, timeZoneName: 'short' });
const parts = new Intl.DateTimeFormat(locale, { timeZone: timeZone, timeZoneName: 'short' }).formatToParts(date);
output += parts.find(it => it.type === 'timeZoneName').value;
break;
}

Expand Down

0 comments on commit c84a12e

Please sign in to comment.