[GH-ISSUE #7] Consider using moment.js for date formatting #5

Closed
opened 2026-02-25 23:39:34 +03:00 by kerem · 1 comment
Owner

Originally created by @poblabs on GitHub (Oct 3, 2019).
Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/7

I'm in the US, and the date format opentrashmail is using doesn't make sense to me at first glance since we use Month/Day/Year format.

moment.js would be great for this type of date formatting to allow others to use the format they're used to.

This could be a quick add by using an option inside config.ini to define the string format, then have PHP grab the string format when it loads $settings, and adding that to the $o array. JavaScript can then grab that string format and format the epoch accordingly.

I have a working example and can submit a PR if you'd like?

Edit: here's the working example: github.com/poblabs/opentrashmail@f82d50b56e

Originally created by @poblabs on GitHub (Oct 3, 2019). Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/7 I'm in the US, and the date format opentrashmail is using doesn't make sense to me at first glance since we use Month/Day/Year format. [moment.js](https://momentjs.com) would be great for this type of date formatting to allow others to use the format they're used to. This could be a quick add by using an option inside config.ini to define the [string format](https://momentjs.com/docs/#/parsing/string-format/), then have PHP grab the string format when it loads `$settings`, and adding that to the `$o` array. JavaScript can then grab that string format and format the epoch accordingly. I have a working example and can submit a PR if you'd like? **Edit**: here's the working example: https://github.com/poblabs/opentrashmail/commit/f82d50b56e27fe4df6e07f74a740284d5cbde352
kerem closed this issue 2026-02-25 23:39:34 +03:00
Author
Owner

@geek-at commented on GitHub (Oct 6, 2019):

sure, send that sweet PR

<!-- gh-comment-id:538724040 --> @geek-at commented on GitHub (Oct 6, 2019): sure, send that sweet PR
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentrashmail#5
No description provided.