Skip to content

Commit

Permalink
[Day One] support a complete timestamp instead of just dates (raycast…
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonNiklasson authored Feb 9, 2024
1 parent 4c2966a commit 2ef041d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions extensions/day-one/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Day One Changelog

## [Feature] - 2024-02-06

- Capture a complete timestamp when creating an entry, instead of just the date

## [Bug fix] - 2024-01-24

- Error handling for when the CLI gets out of sync with the desktop application. Instead of saying "CLI not found", the extension now says "CLI out of sync, launch the desktop application"
Expand Down
6 changes: 3 additions & 3 deletions extensions/day-one/src/add-entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ const AddEntryCommand = ({ draftValues }: LaunchProps) => {
/>
<Form.DatePicker
id="date"
title="Date"
info="You can add entries to any day. Defaults to today."
type={Form.DatePicker.Type.Date}
title="Timestamp"
info="Set the timestamp on this entry. Defaults to now."
type={Form.DatePicker.Type.DateTime}
value={date}
onChange={setDate}
/>
Expand Down
4 changes: 2 additions & 2 deletions extensions/day-one/src/day-one.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export async function isDayOneInstalled(): Promise<CLIState> {
}

async function addEntry(entry: Entry) {
const date = entry.date.toISOString().split("T")[0];
let command = `dayone2 new "${entry.body}" --date "${date}"`;
const date = entry.date.toISOString().split(".")[0] + "Z";
let command = `dayone2 new "${entry.body}" --isoDate "${date}"`;

if (entry.journal) {
command = `${command} --journal ${entry.journal}`;
Expand Down

0 comments on commit 2ef041d

Please sign in to comment.