0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

fix: 🐛 local package last sync time shown as year 1970

This commit is contained in:
Meeeeow 2017-12-02 22:41:33 +08:00 committed by juanpicado
parent 2a69f4e51a
commit aa49098d39

View file

@ -23,12 +23,12 @@ export default class PackageSidebar extends React.Component {
}
async componentDidMount() {
await this.loadPackageData(this.props.packageName)
await this.loadPackageData(this.props.packageName);
}
async componentWillReceiveProps(newProps) {
if (newProps.packageName !== this.props.packageName) {
await this.loadPackageData(newProps.packageName)
await this.loadPackageData(newProps.packageName);
}
}
@ -62,7 +62,7 @@ export default class PackageSidebar extends React.Component {
recentReleases = recentReleases.slice(recentReleases.length - 3, recentReleases.length).reverse();
this.setState({
lastUpdate: (new Date(lastUpdate)).toLocaleString(),
lastUpdate: lastUpdate ? (new Date(lastUpdate)).toLocaleString() : '',
recentReleases,
author: packageMeta.latest.author,
contributors: packageMeta.latest.contributors,