MA importer: fix up regexp, year detection

This commit is contained in:
Laurent Monin 2015-09-27 00:50:45 +02:00
parent ea0d9d61ca
commit 4eb6d1bc59

View file

@ -23,8 +23,7 @@ $(document).ready(function() {
});
function setreleasedate(release, datestring) {
var patt = new RegExp('^d{4}$');
if (patt.exec(datestring)) {
if (/^\d{4}$/.exec(datestring)) {
release.year = datestring;
} else if (datestring.indexOf(',') != -1) {
var commaindex = datestring.indexOf(',');