question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Translating a date results in bad output

See original GitHub issue

My problem is quite simple, the example demonstrates it.

console.log(totpExpiration); // 6/24/2016, 1:01:46 PM
const body = __('SMS_BODY_TEXT', { totp, totpExpiration });
console.log(body); // The code expires at 6/24/2016, 1:01:46 PM

Now the “/” characters become “/” HTML Entity and I did not find anything about escaping my variables for __(). Mind that there is no templating engine here, I will send the string out in SMS.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
klemenszcommented, Jul 27, 2016

Ran into the same issue. Would be nice 🙂 if this was mentioned in the readme. Somebody that uses i18n-node does not necessarily know about mustache (like me).

0reactions
OlivierChirouzecommented, Apr 27, 2018

It’s great to learn there is a simple solution to this issue, but it would be even better to mention it in the readme 😉 Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Ways to Fix Dates Formatted as Text in Excel
6 ways to fix dates formatted ast text in Excel, plus a bonus technique using Power Query to fix various formats.
Read more >
Why does Date.parse give incorrect results? - Stack Overflow
On the output side, all browsers translate time zones the same way but they handle the string formats differently. Here are the toString ......
Read more >
Demystifying DateTime Manipulation in JavaScript - Toptal
Time and date manipulation is notoriously difficult. Developers encountering time zone rules, leap seconds, differences in locale-specific formatting are ...
Read more >
Various ways to use the SQL CONVERT date function
Converting dates using the FORMAT() function. In the above CONVERT() function, we are required to specify style codes for a specific format ...
Read more >
SQL Server functions for converting a String to a Date
Result : Using SQL Server, convert string to date explicitly ... As an example, many times you may face bad date values such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found