Skip to content

fix os.date formatting with %x#534

Open
Andriamanitra wants to merge 1 commit intoyuin:masterfrom
Andriamanitra:master
Open

fix os.date formatting with %x#534
Andriamanitra wants to merge 1 commit intoyuin:masterfrom
Andriamanitra:master

Conversation

@Andriamanitra
Copy link
Copy Markdown

Changes proposed in this pull request:

  • change format code %x to mean %m/%d/%y to match Lua (https://www.lua.org/pil/22.1.html) (before this PR it was %H/%M/%S I assume by mistake)
  • add a test for date formatting

While writing the test I also noticed a few other date formatting codes that don't exactly match what Lua does:

  • %p is "PM" ("pm" in Lua)
  • %c is "02 Jan 06 15:04 MST" ("Mon Jan 2 15:04:05 2006" in Lua)

I decided to not include them in the test. I also left formatting codes that are not documented on lua.org untested.

The issue was first reported in micro: micro-editor/micro#4067

@Andriamanitra
Copy link
Copy Markdown
Author

There is also #465 which is a bigger change that addresses the same issue, but it has been in limbo for a while. I will close this PR if that one is preferable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant