Skip to content

Instantly share code, notes, and snippets.

@dixonsiu
Created August 24, 2017 23:57
Show Gist options
  • Save dixonsiu/9547ba4ffe3d6544738b19de38792a8e to your computer and use it in GitHub Desktop.
Save dixonsiu/9547ba4ffe3d6544738b19de38792a8e to your computer and use it in GitHub Desktop.
Make sure you specify "[html]" when assigning "data-i18n" attribute to avoid escaped characters!!

I have defined the following strings.

var sTerm="2017/08/01";
var eTerm="2017/09/01";

The following will produce escaped "/" as "/".

$("#refSearchTerm").attr("data-i18n","glossary:survey.surveyPeriod").localize({ startDate: sTerm, endDate: eTerm });

2017/08/01 ~ 2017/09/01

To produce the unescaped character "/".

$("#refSearchTerm").attr("data-i18n","[html]glossary:survey.surveyPeriod").localize({ startDate: sTerm, endDate: eTerm });

2017/08/01 ~ 2017/09/01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment