- Timestamp:
- 2017-02-25T14:07:17+01:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/maps.xsd
r11579 r11612 660 660 <!-- A base64-encoded image that is displayed as menu/toolbar icon --> 661 661 <xs:element name="icon" minOccurs="0" maxOccurs="1" type="xs:string" /> 662 <!-- Date in form YYYY-MM-DD;YYYY-MM-DD (each element after first year is optional -->662 <!-- Date in form YYYY-MM-DD;YYYY-MM-DD (each element after first year is optional, a single - marks an unknown or open timespan like -;2015) --> 663 663 <xs:element name="date" minOccurs="0" maxOccurs="1" type="xs:string" /> 664 664 <xs:element name="mirror" minOccurs="0"> -
trunk/scripts/SyncEditorLayerIndex.groovy
r11603 r11612 307 307 /*myprintln "*** Same URL, but different dates: ***" 308 308 for (def url : eliUrls.keySet()) { 309 def e = eliUrls.get(url)309 def ed = getDate(eliUrls.get(url)) 310 310 if (!josmUrls.containsKey(url)) continue 311 311 def j = josmUrls.get(url) 312 if (!getDate(e).equals(getDate(j))) { 313 myprintln "* Date differs ('${getDate(e)}' != '${getDate(j)}'): ${getDescription(j)}" 312 def jd = getDate(j) 313 // The forms 2015;- or -;2015 or 2015;2015 are handled equal to 2015 314 String ef = ed.replaceAll("\\A-;","").replaceAll(";-\\z","").replaceAll("\\A([0-9-]+);\\1\\z","\$1"); 315 if (!ed.equals(jd) && !ef.equals(jd)) { 316 String t = "'${ed}'"; 317 if (!ed.equals(ef)) { 318 t += "or '${ef}'"; 319 } 320 myprintln "* Date differs (${t} != '${jd}'): ${getDescription(j)}" 314 321 } 315 322 }*/ … … 409 416 def d = getDate(j) 410 417 if(!d.isEmpty()) { 411 def reg = (d =~ /^( \d\d\d\d)(-(\d\d)(-(\d\d))?)?(;(\d\d\d\d)(-(\d\d)(-(\d\d))?)?)?/)418 def reg = (d =~ /^(-|(\d\d\d\d)(-(\d\d)(-(\d\d))?)?)(;(-|(\d\d\d\d)(-(\d\d)(-(\d\d))?)?))?/) 412 419 if(reg == null || reg.count != 1) { 413 420 myprintln "* JOSM-Date '${d}' is strange: ${getDescription(j)}" 414 421 } else { 415 422 try { 416 def first = verifyDate(reg[0][ 1],reg[0][3],reg[0][5]);417 def second = verifyDate(reg[0][ 7],reg[0][9],reg[0][11]);423 def first = verifyDate(reg[0][2],reg[0][4],reg[0][6]); 424 def second = verifyDate(reg[0][9],reg[0][11],reg[0][13]); 418 425 if(second.compareTo(first) < 0) { 419 426 myprintln "* JOSM-Date '${d}' is strange (second earlier than first): ${getDescription(j)}" … … 464 471 return start+";"+end 465 472 else if(!start.isEmpty()) 466 return start 467 else 468 return end 473 return start+";-" 474 else if(!end.isEmpty()) 475 return "-;"+end 476 return ""; 469 477 } 470 478 static Date verifyDate(String year, String month, String day) {
Note:
See TracChangeset
for help on using the changeset viewer.