Updated version_info to output unix timestamp

This commit is contained in:
laf
2016-07-31 22:41:39 +01:00
parent c12d02f81b
commit b35321cdad
3 changed files with 3 additions and 3 deletions

View File

@@ -237,5 +237,5 @@ echo "
// convert the version date from ISO 8601 to the browser's timezone // convert the version date from ISO 8601 to the browser's timezone
var ver_date = $('#version_date'); var ver_date = $('#version_date');
ver_date.text(new Date(ver_date.text()).toString()); ver_date.text(moment.unix(ver_date.text()));
</script> </script>

View File

@@ -1038,7 +1038,7 @@ function version_info($remote=true) {
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1); curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
$output['github'] = json_decode(curl_exec($api),true); $output['github'] = json_decode(curl_exec($api),true);
} }
list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ci' -s HEAD`)); list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ct' -s HEAD`));
$output['local_sha'] = $local_sha; $output['local_sha'] = $local_sha;
$output['local_date'] = $local_date; $output['local_date'] = $local_date;
$output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`); $output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);

View File

@@ -76,7 +76,7 @@ $versions = version_info();
echo "Version info:\n"; echo "Version info:\n";
$cur_sha = $versions['local_sha']; $cur_sha = $versions['local_sha'];
if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) { if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) {
$commit_date = new DateTime($versions['local_date'], new DateTimeZone(date_default_timezone_get())); $commit_date = new DateTime('@'.$versions['local_date'], new DateTimeZone(date_default_timezone_get()));
print_warn("Your install is out of date: $cur_sha " . $commit_date->format('(r)')); print_warn("Your install is out of date: $cur_sha " . $commit_date->format('(r)'));
} }
else { else {