-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [ENG-1319] allow user to set explicit end
time, round up end
and duration
to the nearest hour
#70
Conversation
…`parseStartDate` function
…ient `.POST` method
Changed Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds explicit end time setting and duration rounding functionality to the CLI, focusing on order management and improving type safety with Deno.
- Added
-e/--end
option insrc/lib/buy/index.tsx
that conflicts with-d/--duration
, ensuring exactly one is specified - Centralized date parsing in
src/helpers/units.ts
with newparseStartDate
function that handles both string and Date inputs - Removed redundant
orders_create
endpoint fromsrc/helpers/urls.ts
, suggesting order creation flow changes - Added compiler option
deno.ns
indeno.json
to support Deno's standard library features - Introduced coding guidelines in
.cursor/rules/cli.mdc
for consistent Node.js imports and API client usage
25 file(s) reviewed, 13 comment(s)
Edit PR Review Bot Settings | Greptile
export function parseStartDate(startDate?: string | Date): Date { | ||
if (startDate instanceof Date) return startDate; | ||
const result = parseStartDateOrNow(startDate); | ||
return result === "NOW" ? new Date() : result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an ideal world this would be called like coerceStartDateToDate
but this is a pedantic nit
…r to function call
Fixes the error where a user sets an explicit duration for a buy order, and it doesn't end on an hour boundary. Rounds the end time/duration up to the next hour boundary.