Skip to content
This repository was archived by the owner on Jul 2, 2023. It is now read-only.

Commit cf7c983

Browse files
Merge pull request #86 from AndresMorelos/fixing-payment-date
Fixing createdAt Picker and Form Validation.
2 parents a8bbe79 + a210ea7 commit cf7c983

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

app/components/form/CreatedAt.jsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class CreatedAt extends Component {
1515
super(props);
1616
this.state = { created_at: this.props.created_at };
1717
this.updateCustomDate = this.updateCustomDate.bind(this);
18-
this.updatePaymentTerm = this.updatePaymentTerm.bind(this);
1918
this.updateCreateAt = this.updateCreateAt.bind(this);
2019
}
2120

@@ -33,14 +32,8 @@ export class CreatedAt extends Component {
3332
});
3433
}
3534

36-
updatePaymentTerm(paymentTerm) {
37-
this.setState({ paymentTerm }, () => {
38-
this.updateCreateAt(this.state);
39-
});
40-
}
41-
42-
updateCreateAt(data) {
43-
this.props.updateFieldData('created_at', data);
35+
updateCreateAt({ created_at }) {
36+
this.props.updateFieldData('created_at', created_at);
4437
}
4538

4639
render() {

app/helpers/form.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ function getInvoiceData(formData, secretKey) {
9595

9696
if (editMode.active) {
9797
createdAtToUpdate =
98-
created_at.created_at !== editMode.data.created_at
99-
? created_at.created_at
98+
created_at && created_at !== editMode.data.created_at
99+
? created_at
100100
: editMode.data.created_at;
101101
}
102102

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "invoncify",
33
"homepage": "https://invoncify.andresmorelos.me",
44
"productName": "Invoncify",
5-
"version": "1.19.0",
5+
"version": "1.19.1",
66
"license": "GPL-3.0",
77
"description": "Flexible invoicing desktop app with beautiful & customizable templates",
88
"author": {

0 commit comments

Comments
 (0)