Skip to content

Commit

Permalink
fix: date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Oct 12, 2024
1 parent a206418 commit 7e3998a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 90 deletions.
128 changes: 43 additions & 85 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@filen/webdav",
"version": "0.2.52",
"version": "0.2.53",
"description": "Filen WebDAV",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -55,7 +55,6 @@
"dependencies": {
"@filen/sdk": "^0.1.167",
"body-parser": "^1.20.2",
"dayjs": "^1.11.11",
"express": "^4.19.2",
"express-rate-limit": "^7.4.0",
"fs-extra": "^11.2.0",
Expand Down
5 changes: 2 additions & 3 deletions src/responses.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type Response } from "express"
import { Builder } from "xml2js"
import { type Resource } from "."
import dayjs from "dayjs"
import mimeTypes from "mime-types"

/**
Expand Down Expand Up @@ -33,11 +32,11 @@ export class Responses {
"D:href": `${encodeURI(resource.url)}`,
["D:propstat"]: {
"D:prop": {
"D:getlastmodified": dayjs(resource.mtimeMs).format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),
"D:getlastmodified": new Date(resource.mtimeMs).toUTCString(),
"D:displayname": encodeURIComponent(resource.name),
"D:getcontentlength": resource.type === "directory" ? 0 : resource.size,
"D:getetag": resource.uuid,
"D:creationdate": dayjs(resource.birthtimeMs).format("ddd, DD MMM YYYY HH:mm:ss [GMT]"),
"D:creationdate": new Date(resource.birthtimeMs).toISOString(),
"D:quota-available-bytes": quota.available.toString(),
"D:quota-used-bytes": quota.used.toString(),
"D:getcontenttype":
Expand Down

0 comments on commit 7e3998a

Please sign in to comment.