Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ jobs:

- name: Initialize CodeQL
if: env.SKIP != 'true'
uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Analyze
if: env.SKIP != 'true'
uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
with:
category: "/language:${{ matrix.language }}"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ jobs:
# roughly 600 of windows-latest's 694. test.yml has cached since it was written; the
# build matrix simply never got one.
- name: Cache Rust dependencies
uses: swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
uses: swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: src-tauri -> target

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
# roughly daily. A `Cargo.lock` or rustc change between releases means develop runs cold
# until the next one - the honest cost of three entries instead of nine.
- name: Cache Rust dependencies
uses: swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
uses: swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: src-tauri -> target
save-if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ popover, not for the person who wrote the commit.

## [Unreleased]

## [1.11.5] - 2026-11-05

### Fixed

- **Importing an older export no longer swaps day and month.** Archives from before the export
format changed carry dates the way the exporting computer wrote them, and on a computer set
to a day-first format such as British English, every stash created up to the 12th of a month
came back with day and month swapped - 12 March became 3 December. Stashes already imported
keep the dates they were given

## [1.11.4] - 2026-11-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stashpad",
"version": "1.11.4",
"version": "1.11.5",
"description": "The staging area for your AI context.",
"author": {
"name": "Nico Wiedemann",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

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

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stashpad"
version = "1.11.4"
version = "1.11.5"
description = "The staging area for your AI context."
authors = ["Nico Wiedemann <nico.wiedemann@gmail.com>"]
repository = "https://github.com/EarMaster/stashpad"
Expand Down
24 changes: 18 additions & 6 deletions src-tauri/src/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,24 @@ fn parse_heading_date(raw: &str) -> Option<Instant> {

/// The `toLocaleString()` forms older exports used, which no ISO parser reads:
///
/// * `8/20/2026, 10:14:32 AM` and `8/20/2026, 10:14:32` - en-US, month first
/// * `8/20/2026, 10:14:32 AM` - en-US, month first
/// * `20.8.2026, 10:14:32` and `20.8.2026 10:14:32` - de-DE
/// * `20/8/2026, 10:14:32` and `20/8/2026 10:14:32` - en-GB and similar, day first
/// * `20/8/2026, 10:14:32 am` - en-AU, en-IN and similar, day first
///
/// A slash date is tried month first, as en-US is far the more common, and read day first
/// only when that cannot be a date - the same order the formats were tried in before.
/// **A slash date is month first only beside an upper-case `AM`/`PM`.** en-US
/// `toLocaleString()` always writes one, and the day-first slash locales write either a
/// 24-hour clock or a lower-case `am`/`pm`. This used to try month first for every slash
/// date and fall back to day first only when month first was impossible, so an en-GB
/// archive's `12/03/2026` - 12 March - came back as 3 December, and every date up to the
/// 12th of a month was silently swapped on import. The other order is still tried when the
/// preferred one cannot be a date, so a stray `8/20/2026, 22:14:32` reads as 20 August.
fn parse_locale_heading(text: &str) -> Option<Instant> {
let (date, rest) = text.split_once([',', ' '])?;
let mut clock = rest.trim_start_matches([',', ' ']).split(' ');
let hms = clock.next()?;
let meridiem = clock.next();
let month_first = matches!(meridiem, Some("AM" | "PM"));
if clock.next().is_some() {
return None;
}
Expand Down Expand Up @@ -196,7 +203,8 @@ fn parse_locale_heading(text: &str) -> Option<Instant> {
)
};
match separator {
'/' => at(a, b).or_else(|| at(b, a)),
'/' if month_first => at(a, b).or_else(|| at(b, a)),
'/' => at(b, a).or_else(|| at(a, b)),
_ => at(b, a),
}
}
Expand Down Expand Up @@ -1425,10 +1433,14 @@ old
("8/20/2026, 12:05:00 PM", "2026-08-20 12:05:00"),
("8/20/2026, 22:14:32", "2026-08-20 22:14:32"),
("20.08.2026 10:14:32", "2026-08-20 10:14:32"),
// Day first only when month first cannot be a date.
("20/8/2026, 10:14:32", "2026-08-20 10:14:32"),
("20/8/2026 10:14:32", "2026-08-20 10:14:32"),
("3/4/2026, 10:14:32", "2026-03-04 10:14:32"),
// Month first only beside an upper-case meridiem, which only en-US writes.
("3/4/2026, 10:14:32 AM", "2026-03-04 10:14:32"),
// Day first otherwise: en-GB's 24-hour clock, en-AU's lower-case am/pm.
("3/4/2026, 10:14:32", "2026-04-03 10:14:32"),
("12/03/2026, 09:25:39", "2026-03-12 09:25:39"),
("3/4/2026, 10:14:32 pm", "2026-04-03 22:14:32"),
("2026-08-20T10:14:32", "2026-08-20 10:14:32"),
("2026-08-20", "2026-08-20 00:00:00"),
("2026-08-20T10:14:32+02:00", "2026-08-20 08:14:32"),
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "stashpad",
"version": "1.11.4",
"version": "1.11.5",
"identifier": "org.stashpad",
"build": {
"frontendDist": "../dist",
Expand Down
Loading