Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs about escaping with curly brackets #502

Merged
merged 1 commit into from
Feb 19, 2019
Merged

Fix docs about escaping with curly brackets #502

merged 1 commit into from
Feb 19, 2019

Conversation

denis-sokolov
Copy link
Contributor

The current behavior is treat curly brackets as regular characters, only the square brackets have special behavior.

Related code:

dayjs/src/index.js

Lines 304 to 307 in 8ede9b7

return str.replace(C.REGEX_FORMAT, (match) => {
if (match.indexOf('[') > -1) return match.replace(/\[|\]/g, '')
return matches[match] || zoneStr.replace(':', '') // 'ZZ'
})

export const REGEX_FORMAT = /\[.*?\]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g

The current behavior is treat curly brackets as regular characters, only the square brackets have special behavior.
@codecov-io
Copy link

codecov-io commented Feb 19, 2019

Codecov Report

Merging #502 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #502   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files        58     58           
  Lines       511    511           
  Branches     85     85           
===================================
  Hits        511    511

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4cd3ad...2931fe2. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Feb 19, 2019

Yes, thanks.

@iamkun iamkun merged commit 4accf0e into iamkun:dev Feb 19, 2019
@iamkun
Copy link
Owner

iamkun commented Feb 24, 2019

🎉 This PR is included in version 1.8.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants