Skip to content

fix: Format dates as YYYY-MM-DD in ft md exports instead of using raw string slice#63

Closed
ccage-simp wants to merge 1 commit into
afar1:mainfrom
ccage-simp:fix/md-filenames
Closed

fix: Format dates as YYYY-MM-DD in ft md exports instead of using raw string slice#63
ccage-simp wants to merge 1 commit into
afar1:mainfrom
ccage-simp:fix/md-filenames

Conversation

@ccage-simp
Copy link
Copy Markdown
Contributor

Description

In v1.3.2, the new ft md command generates markdown files using a simple string slice on the postedAt or bookmarkedAt database field: date.slice(0, 10).

While this works for standard ISO string timestamps (2024-11-27), it fundamentally breaks for any user whose database still contains bookmarks in the legacy Twitter date format (Fri Apr 01 16:02:20 +0000 2022).

For legacy timestamps, slicing the first 10 characters yields Fri Apr 01. This results in markdown exports with filenames like Fri Apr 01-author-slug.md which:

  1. Cannot be sorted chronologically by the filesystem.
  2. Are missing the year entirely.
  3. Contain spaces, making them harder to script against.

The Fix

This PR replaces the raw string slice with a robust Date parser in src/md-export.ts. It parses whatever timestamp format exists in the database and explicitly constructs a uniform, sortable YYYY-MM-DD prefix for every exported file.

@ccage-simp ccage-simp marked this pull request as ready for review April 9, 2026 03:12
@MrDwarf7
Copy link
Copy Markdown

Related #69

@afar1
Copy link
Copy Markdown
Owner

afar1 commented Apr 12, 2026

reviewing

@ccage-simp
Copy link
Copy Markdown
Contributor Author

Closing. Being considered in #53.

@ccage-simp ccage-simp closed this Apr 15, 2026
@ccage-simp ccage-simp reopened this Apr 17, 2026
@ccage-simp
Copy link
Copy Markdown
Contributor Author

Reopened. Apologies @afar1 if I confused things related to issue #53 and your plan to address this.

Copy link
Copy Markdown
Owner

afar1 commented Apr 19, 2026

Thanks for surfacing and patching this. The merged fix in #104 covers the markdown date regression end-to-end, including the broader export path we needed, so I’m closing this one as superseded.

@afar1 afar1 closed this Apr 19, 2026
@ccage-simp ccage-simp deleted the fix/md-filenames branch April 20, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants