Added datatype Date

This commit is contained in:
Jeroen De Meerleer 2019-02-01 15:55:13 +01:00
parent a71b77edd5
commit 35f47f268f
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -277,12 +277,12 @@ class Sws extends SwsModel
// StartDate
$length = 4;
$sws->getTournament()->setStartDate(self::UIntToTimestamp(self::ReadData('Int', substr($swscontents, $offset, $length))));
$sws->getTournament()->setStartDate(self::ReadData('Date', substr($swscontents, $offset, $length)));
$offset += $length;
// EndDate
$length = 4;
$sws->getTournament()->setEndDate(self::UIntToTimestamp(self::ReadData('Int', substr($swscontents, $offset, $length))));
$sws->getTournament()->setEndDate(self::ReadData('Date', substr($swscontents, $offset, $length)));
$offset += $length;
// Place
@ -352,6 +352,7 @@ class Sws extends SwsModel
break;
case 'Hex':
case 'Int':
case 'Date':
$hex = implode(unpack("H*", $data));
$hex = array_reverse(str_split($hex, 2));
@ -368,6 +369,8 @@ class Sws extends SwsModel
return $hex;
} elseif ($type == 'Int') {
return hexdec($hex);
} elseif ($type == 'Date') {
return self::UIntToTimestamp(hexdec($hex));
}
break;
default: