mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-24 07:21:01 +01:00
Added datatype Date
This commit is contained in:
parent
a71b77edd5
commit
35f47f268f
@ -277,12 +277,12 @@ class Sws extends SwsModel
|
|||||||
|
|
||||||
// StartDate
|
// StartDate
|
||||||
$length = 4;
|
$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;
|
$offset += $length;
|
||||||
|
|
||||||
// EndDate
|
// EndDate
|
||||||
$length = 4;
|
$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;
|
$offset += $length;
|
||||||
|
|
||||||
// Place
|
// Place
|
||||||
@ -352,6 +352,7 @@ class Sws extends SwsModel
|
|||||||
break;
|
break;
|
||||||
case 'Hex':
|
case 'Hex':
|
||||||
case 'Int':
|
case 'Int':
|
||||||
|
case 'Date':
|
||||||
$hex = implode(unpack("H*", $data));
|
$hex = implode(unpack("H*", $data));
|
||||||
$hex = array_reverse(str_split($hex, 2));
|
$hex = array_reverse(str_split($hex, 2));
|
||||||
|
|
||||||
@ -368,6 +369,8 @@ class Sws extends SwsModel
|
|||||||
return $hex;
|
return $hex;
|
||||||
} elseif ($type == 'Int') {
|
} elseif ($type == 'Int') {
|
||||||
return hexdec($hex);
|
return hexdec($hex);
|
||||||
|
} elseif ($type == 'Date') {
|
||||||
|
return self::UIntToTimestamp(hexdec($hex));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user