feat: updated created_at and modified_at from JS unix epoch to ISO 8601 for ease-of-use

This commit is contained in:
Kacper Kula 2025-01-31 13:24:00 +00:00
parent 2d1b3cbff4
commit 42e6b3bfd0
6 changed files with 15 additions and 7 deletions

View file

@ -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

View file

@ -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` | |

View file

@ -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",

View file

@ -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": {

View file

@ -23,8 +23,8 @@ function fileData(file: TFile, { tags: _tags, ...frontmatter }: Record<string, a
id: file.path,
path: file.path,
name: file.name.replace(/\.[^/.]+$/, ""),
created_at: file.stat.ctime,
modified_at: file.stat.mtime,
created_at: (new Date(file.stat.ctime)).toISOString(),
modified_at: (new Date(file.stat.mtime)).toISOString(),
file_size: file.stat.size
}
}

View file

@ -35,5 +35,6 @@
"0.21.0": "0.15.0",
"0.21.1": "0.15.0",
"0.21.2": "0.15.0",
"0.21.3": "0.15.0"
"0.21.3": "0.15.0",
"0.22.0": "0.15.0"
}