Skip to content

Commit

Permalink
Fixes the regex to match the missing cases of special unicode chars (…
Browse files Browse the repository at this point in the history
…Latin languages)
  • Loading branch information
yash committed Jan 18, 2016
1 parent 30cfad6 commit eaa59d2
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]+|\S+/ )[ 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 eaa59d2

Please sign in to comment.