Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.inc |
— | — | @@ -463,10 +463,14 @@ |
464 | 464 | $month = $date['month']; |
465 | 465 | $day = $date['day']; |
466 | 466 | } else { |
467 | | - $actual_date = strtotime($date); |
468 | | - $year = date("Y", $actual_date); |
469 | | - $month = date("n", $actual_date); |
470 | | - $day = date("j", $actual_date); |
| 467 | + $actual_date = new SMWTimeValue('_dat'); |
| 468 | + $actual_date->setUserValue($date); |
| 469 | + $year = $actual_date->getYear(); |
| 470 | + // TODO - the code to convert from negative to BC notation should |
| 471 | + // be in SMW itself |
| 472 | + if ($year < 0) {$year = ($year * -1 + 1) . " BC";} |
| 473 | + $month = $actual_date->getMonth(); |
| 474 | + $day = $actual_date->getDay(); |
471 | 475 | } |
472 | 476 | } else { |
473 | 477 | $cur_date = getdate(); |
— | — | @@ -505,6 +509,8 @@ |
506 | 510 | } |
507 | 511 | if (isset($datetime['timezone'])) $timezone = $datetime['timezone']; |
508 | 512 | } else { |
| 513 | + // TODO - this should change to use SMW's own date-handling class, |
| 514 | + // just like dateEntryHTML() does |
509 | 515 | $actual_date = strtotime($datetime); |
510 | 516 | if ($sfg24HourTime) { |
511 | 517 | $hour = date("G", $actual_date); |