ipfs-utils
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -0,1 +1,11 @@ | ||
<a name="0.4.2"></a> | ||
## [0.4.2](https://github.com/ipfs/js-ipfs-utils/compare/v0.4.1...v0.4.2) (2020-01-08) | ||
### Bug Fixes | ||
* format mtime as timespec ([#19](https://github.com/ipfs/js-ipfs-utils/issues/19)) ([22d326f](https://github.com/ipfs/js-ipfs-utils/commit/22d326f)) | ||
<a name="0.4.1"></a> | ||
@@ -2,0 +12,0 @@ ## [0.4.1](https://github.com/ipfs/js-ipfs-utils/compare/v0.4.0...v0.4.1) (2019-12-11) |
{ | ||
"name": "ipfs-utils", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
'use strict' | ||
function formatMtime (mtime) { | ||
if (mtime === undefined) { | ||
if (mtime == null) { | ||
return '-' | ||
} | ||
return new Date(mtime * 1000).toLocaleDateString(Intl.DateTimeFormat().resolvedOptions().locale, { | ||
const date = new Date((mtime.secs * 1000) + Math.round(mtime.nsecs / 1000)) | ||
return date.toLocaleDateString(Intl.DateTimeFormat().resolvedOptions().locale, { | ||
year: 'numeric', | ||
@@ -10,0 +12,0 @@ month: 'short', |
45743
730