Skip to content

Commit

Permalink
two more places to remove timezone information
Browse files Browse the repository at this point in the history
  • Loading branch information
hatton committed Feb 5, 2024
1 parent 9239dc4 commit 10b1e22
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"main": "dist/src/mainProcess/main.js",
"name": "lameta",
"productName": "lameta",
"version": "2.2.6-alpha",
"version": "2.2.7-alpha",
"author": {
"name": "lameta",
"email": "sorryno@email.org"
Expand Down
4 changes: 3 additions & 1 deletion src/components/DateFieldEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ DateFieldEdit extends React.Component<
onChange={(newDate) => {
if (newDate != null) {
// TODO: while this is changing the value, it's not propagating back to our props so you don't see the change immediately
this.props.field.setValueFromString(newDate.toISOString());
this.props.field.setValueFromString(
newDate.toISOString().slice(0, 10) /*remove time portion*/
);
}
}}
/>
Expand Down
3 changes: 2 additions & 1 deletion src/model/field/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ export class Field {

public asISODateString(): string {
// our rule is that we always keep strings in "YYYY-MM-DD" format, and it's always UTC
return this.text;
// remove time if it's there
return this.text.slice(0, 10);
}
// public asDateDisplayString(): string {
// const m = moment(this.text);
Expand Down

0 comments on commit 10b1e22

Please sign in to comment.