Change date format when getting log from mercurial
Use rfc3339date format instead of rfc822date to avoid exceptions from DateTime constructor because of localized dates. fix #2346pull/2347/head
parent
efb41d467e
commit
4198688f54
|
@ -124,7 +124,7 @@ class HgDriver extends VcsDriver
|
|||
$composer = JsonFile::parseJson($composer, $identifier);
|
||||
|
||||
if (!isset($composer['time'])) {
|
||||
$this->process->execute(sprintf('hg log --template "{date|rfc822date}" -r %s', escapeshellarg($identifier)), $output, $this->repoDir);
|
||||
$this->process->execute(sprintf('hg log --template "{date|rfc3339date}" -r %s', escapeshellarg($identifier)), $output, $this->repoDir);
|
||||
$date = new \DateTime(trim($output), new \DateTimeZone('UTC'));
|
||||
$composer['time'] = $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue