Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Swap client-side moment with dayjs
Browse files Browse the repository at this point in the history
  • Loading branch information
zarathustra323 committed May 19, 2022
1 parent 057e48d commit bea8968
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/marko-web-identity-x/browser/comments/post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script>
import moment from 'moment';
import dayjs from '../dayjs';
import post from '../utils/post';
import FormError from '../errors/form';
import EventEmitter from '../mixins/global-event-emitter';
Expand Down Expand Up @@ -101,7 +101,7 @@ export default {
postedAt() {
const { createdAt } = this;
if (!createdAt) return null;
return moment(createdAt).format(this.dateFormat);
return dayjs(createdAt).format(this.dateFormat);
},
/**
Expand Down
6 changes: 6 additions & 0 deletions packages/marko-web-identity-x/browser/dayjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat';

dayjs.extend(advancedFormat);

export default dayjs;
2 changes: 1 addition & 1 deletion packages/marko-web-identity-x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"apollo-link-http": "^1.5.17",
"body-parser": "^1.19.0",
"cookie": "0.3.1",
"dayjs": "^1.11.2",
"express": "^4.17.1",
"graphql-tag": "^2.12.5",
"moment": "^2.29.1",
"node-fetch": "^2.6.5"
},
"peerDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7386,6 +7386,11 @@ dateformat@^3.0.0:
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==

dayjs@^1.11.2:
version "1.11.2"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.2.tgz#fa0f5223ef0d6724b3d8327134890cfe3d72fbe5"
integrity sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==

de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
Expand Down

0 comments on commit bea8968

Please sign in to comment.