Skip to content

Commit

Permalink
Merge pull request #821 from mehtayash/master
Browse files Browse the repository at this point in the history
Fixes the handling of unicode special characters causing errors in i18n
  • Loading branch information
amsul authored Jul 8, 2019
2 parents 23f96ec + eaa59d2 commit 0fd34ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/picker.date.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ DatePicker.prototype.formats = (function() {

// Grab the first word from the string.
// Regex pattern from http://stackoverflow.com/q/150033
var word = string.match( /[^\x00-\x7F]+|\w+/ )[ 0 ]
var word = string.match( /[^\x00-\x7F]+|[a-zA-Z0-9_\u0080-\u00FF]+/ )[ 0 ]

// If there's no month index, add it to the date object
if ( !dateObject.mm && !dateObject.m ) {
Expand All @@ -661,7 +661,7 @@ DatePicker.prototype.formats = (function() {

// Get the length of the first word in a string.
function getFirstWordLength( string ) {
return string.match( /\w+/ )[ 0 ].length
return string.match( /[a-zA-Z0-9_\u0080-\u00FF]+/ )[ 0 ].length
}

return {
Expand Down

0 comments on commit 0fd34ea

Please sign in to comment.