From a37d77e51ff0f138e44da1e8ededcb1e52b6dcb9 Mon Sep 17 00:00:00 2001 From: Timothy Farrell Date: Sat, 23 Dec 2017 01:11:55 -0600 Subject: [PATCH] Swap Moment for date-fns and save 300KB --- packages/gallery/package.json | 2 +- packages/gallery/src/interface/allImages.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/gallery/package.json b/packages/gallery/package.json index cbb0511..ffd1e65 100644 --- a/packages/gallery/package.json +++ b/packages/gallery/package.json @@ -13,11 +13,11 @@ }, "dependencies": { "css-loader": "^0.28.7", + "date-fns": "~1.29.0", "domvm": "~3.2.1", "exif-parser": "~0.1.9", "extract-text-webpack-plugin": "^3.0.2", "frptools": "3.0.1", - "moment": "~2.19.3", "pica": "~2.0.8", "pouchdb-adapter-http": "~6.3.4", "pouchdb-adapter-idb": "~6.3.4", diff --git a/packages/gallery/src/interface/allImages.js b/packages/gallery/src/interface/allImages.js index 875ce3e..7936849 100644 --- a/packages/gallery/src/interface/allImages.js +++ b/packages/gallery/src/interface/allImages.js @@ -1,4 +1,4 @@ -import * as moment from 'moment'; +import { format } from 'date-fns'; import { prop, computed, container } from 'frptools'; import { @@ -43,7 +43,7 @@ export function AllImagesView(vm, params, key, { appbar }) { const res = Object.entries(sectionMap).reduce( (acc, [date, sectionImages]) => Object.assign(acc, { - [moment(date).format('LL')]: sectionImages + [format(date, 'MMMM D, YYYY')]: sectionImages }), {} );