Skip to content

Update width of datetime formatting to accommodate change in Japan datetime era - #9503

Merged
Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:datetime-format
May 2, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:datetime-format

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Apr 30, 2019 •

Copy link
Copy Markdown
Member

PR Summary

With the new Emperor, Japan is entering a new era which affects the format of their datetime. It needs one more character to the width. Since I don't anticipate this change happening again (the last time I believe was hundreds of years ago), I'm simply updating the width from 25 to 26 rather than defining a const.

PR Checklist

@PoshChan

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), your last commit had 1 failures in PowerShell-CI-static-analysis
Verify Markdown Links.Verify links in /home/vsts/work/1/s/docs/building/windows-core.md.https://www.microsoft.com/net/core#windowscmd should work

retry of URL failed with error: 
at <ScriptBlock>, /home/vsts/work/1/s/test/common/markdown/markdown-link.tests.ps1: line 113
113:                                 throw "retry of URL failed with error: $($_.Message)"

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry static

@PoshChan

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-static-analysis

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label May 1, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.1 milestone May 1, 2019
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit eedb37f into PowerShell:master May 2, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the datetime-format branch May 2, 2019 16:43
@stknohg

Copy link
Copy Markdown
Contributor

This pull request probably corrects the display of "元年"(the first year), but I think it seems to have no effect.
I tried to display "元年" with the latest master build(2be3db8).

Language Setting

fig01

  • Using Japanese Era

Result of dir command

fig02

C:\> $PSVersionTable.GitCommitId
6.2.0-rc.1-219-g2be3db8ab8757fe9ecccd2cc545ae9044ed76574
C:\> dir


    Directory: C:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          平成31年4月26日    14:58                Go
d----          平成31年4月18日    17:36                Intel
d----          平成30年9月15日    16:33                PerfLogs
d-r--            令和元年5月7日    18:28                Program Files
d-r--            令和元年5月7日    15:34                Program Files (x86)
d----            令和元年5月8日     9:38                Program Files2
d----          平成31年4月26日    16:08                project
d----            令和元年5月7日    15:56                temp
d-r--          平成31年4月26日    13:36                Users
d----            令和元年5月7日    10:42                Windows
d----            令和元年5月7日     9:19                Windows.old
  • LastWriteTime width is 26.
  • 元年 is 2 Full width charactors. "令和元年5月7日"(=2019.05.07) has 8 charactors, so the date of LastWriteTime starts with 2 whitespaces.

@stknohg

Takuya Shibata (stknohg) commented May 8, 2019 •

Copy link
Copy Markdown
Contributor

To solve this problem fundamentally, it is necessary to handle the east asian full width character's width correctly.
(related issue ; #6290)

This full width charactor problem is very difficult, I think it is better to revert this commit and simply ignore the display collapse.

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants