Skip to content

来週の曜日・月末・日数後の日付候補を追加する - #369

Closed
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/relative-date-candidates
Closed

来週の曜日・月末・日数後の日付候補を追加する#369
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/relative-date-candidates

Conversation

@sinoda1114

@sinoda1114 sinoda1114 commented Sep 5, 2026

Copy link
Copy Markdown

らいしゅうのげつよう、げつまつ、3にちごなどを日付へ変換します。来週は月曜始まり、日数は0〜3660日を対象とします。

検証

週/月/年境界・うるう年・DST・入力範囲をテスト。

このブランチ単独で swift test --package-path Core --jobs 4 を実行し、Coreの77テストが成功しました。git diff --check も成功しています。

変換範囲と処理負荷

既存日付変換と相対日付で書式・候補スコアの定義を共有します。数字部分は最大4桁です。文節編集中は全入力向けの日付候補を追加しません。

Copilot AI lite review requested due to automatic review settings September 5, 2026 03:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T03:46:10.024646Z 3fb0426 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

READMEの仕様説明が実装(ニチゴの数字部最大4桁制限)と一致していないため、ユーザー向け仕様が誤解されないよう修正が必要です。

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

相対日付(「らいしゅうのげつよう(び)」「げつまつ」「3にちご」など)を日付候補として変換候補に追加し、既存の通常候補も維持したまま入力体験を拡張するPRです。

Changes:

  • 相対日付文字列を解釈して対象日付を算出し、複数フォーマットの候補を生成する RelativeDateShortcuts を追加
  • SegmentsManager.updateRawCandidate で相対日付候補を既存候補へ重複排除しつつ挿入
  • 週/月/年境界、うるう年、DST、入力範囲などのテストを追加し、READMEに機能説明を追記
File summaries
File Description
README.md 相対日付変換機能の説明を追加
Core/Tests/CoreTests/InputUtilsTests/RelativeDateShortcutsTests.swift 相対日付解釈・候補生成・入力コミットのテストを追加
Core/Sources/Core/InputUtils/SegmentsManager.swift 変換候補生成時に相対日付候補を挿入
Core/Sources/Core/InputUtils/RelativeDateShortcuts.swift 相対日付の解釈と候補生成ロジックを追加
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +68 to +76
let formats: [Format] = [
.init(pattern: "M/d", value: -18, calendar: .gregorian),
.init(pattern: "yyyy/MM/dd", value: -18.1, calendar: .gregorian),
.init(pattern: "yyyy-MM-dd", value: -18.2, calendar: .gregorian),
.init(pattern: "M月d日(E)", value: -18.3, calendar: .gregorian),
.init(pattern: "yyyy年M月d日", value: -18.4, calendar: .gregorian),
.init(pattern: "Gyyyy年M月d日", value: -18.5, calendar: .japanese),
.init(pattern: "E曜日", value: -18.6, calendar: .gregorian)
]
Comment thread README.md Outdated

## 機能

* 相対日付変換:「らいしゅうのげつよう(び)」など全曜日、「げつまつ」、「3にちご」を日付候補に追加します。来週は月曜始まりの次週、月末は今月末、日数は今日基準の0〜3660日(半角・全角数字)です。通常の変換候補も残ります。
@ensan-hcl

Copy link
Copy Markdown
Member

このレイヤーのロジックはAzooKeyKanaKanjiConverter側に入れたいです。

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