From 42e6b3bfd04b4e7e373e24f72aeef3d5489fcbe1 Mon Sep 17 00:00:00 2001 From: Kacper Kula Date: Fri, 31 Jan 2025 13:24:00 +0000 Subject: [PATCH] feat: updated created_at and modified_at from JS unix epoch to ISO 8601 for ease-of-use --- CHANGELOG.md | 7 +++++++ docs/data-sources/vault-data.md | 4 ++-- manifest.json | 2 +- package.json | 2 +- src/vaultSync/tables/filesTable.ts | 4 ++-- versions.json | 3 ++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25478a4..526c83d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.22.0 (2025-01-31) +Breaking change: `created_at` and `modified_at` has been changed from JS unix epoch to ISO 8601 dates (human readable). Thanks to that many of date operations are now easier to perform. +Example, extracting year from the creation date: +Before: `strftime("%Y", datetime(ROUND(created_at / 1000), 'unixepoch'))` +Now: `strftime("%Y", created_at)` + + # 0.21.3 (2025-01-31) - fix: fixed issue with inline queries breaking rendering diff --git a/docs/data-sources/vault-data.md b/docs/data-sources/vault-data.md index 59cb844..86cd18a 100644 --- a/docs/data-sources/vault-data.md +++ b/docs/data-sources/vault-data.md @@ -18,8 +18,8 @@ Files table consists of the following columns: | `id` | File Path | | | `path` | Same as `id`, file path | | | `name` | Name of the file, without path and extension | | -| `created_at` | Time of creation (unix timestamp). You can use it to order files by their creation date | 0.18.1 | -| `modified_at` | Time of last modification (unix timestamp). You can use it to odrer files by their modification | 0.18.1 | +| `created_at` | Time of creation (ISO 8601). You can use it to order files by their creation date. Before version 0.22.0 value was unixepoch * 1000 (JavaScript epoch) | 0.18.1 | +| `modified_at` | Time of last modification (ISO 8601). You can use it to odrer files by their modification. Before version 0.22.0 value was unixepoch * 1000 (JavaScript epoch) | 0.18.1 | | `file_size` | Size of the file on disk (in bytes) | 0.18.1 | | All file properties | All file properties are also added to the table. All the special characters will be transformed to underscores `_`, so for example `note type` will be accessible as `note_type` | | diff --git a/manifest.json b/manifest.json index 8594dec..6c4c3f7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "sqlseal", "name": "SQLSeal", - "version": "0.21.3", + "version": "0.22.0", "minAppVersion": "0.15.0", "description": "Use SQL in your notes to query your vault files and CSV content.", "author": "hypersphere", diff --git a/package.json b/package.json index 1dffd79..5e4df48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sqlseal", - "version": "0.21.3", + "version": "0.22.0", "description": "A plugin for Obsidian that allows you to run SQL queries on your notes.", "main": "main.js", "scripts": { diff --git a/src/vaultSync/tables/filesTable.ts b/src/vaultSync/tables/filesTable.ts index 595fe63..d62ab07 100644 --- a/src/vaultSync/tables/filesTable.ts +++ b/src/vaultSync/tables/filesTable.ts @@ -23,8 +23,8 @@ function fileData(file: TFile, { tags: _tags, ...frontmatter }: Record