Automattic / Automattic/o2

o2.Utilities.phpToMoment do not handle escaped characters

Open
#135 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
338
Forks
56
Avg merge
24m
Merged PRs (30d)
16

Description

The current [`o2.Utilities.phpToMoment`](https://github.com/Automattic/o2/blob/9a8be6b17fbfe4c4cb55ac88597020d89279057d/js/utils/timestamp.js#L6-L126) method is not able to handle escaped characters like:

```
j \d\e F \d\e Y
```

This will result in the follow output:

```
24 \122403:00 April \24\-03:00 2017
```

And causing issues on https://br.wordpress.org/team/, https://pt.wordpress.org/team/, and possible other languages.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in js/utils/timestamp.js at o2.Utilities.phpToMoment and reproduce the issue with the format string `j \d\e F \d\e Y`. Verify that escaped characters are handled as literals rather than being interpreted as date tokens, and that the resulting localized date output is corrected for the affected WordPress team pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
localization
Issue type
Bug
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.