mirror of
https://github.com/corda/corda.git
synced 2025-01-02 19:26:47 +00:00
Date change now works first time for changing a single day.
This commit is contained in:
parent
914e6cf52c
commit
89e8708e76
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
function formatDateForNode(date) {
|
function formatDateForNode(date) {
|
||||||
// Produces yyyy-dd-mm. JS is missing proper date formatting libs
|
// Produces yyyy-dd-mm. JS is missing proper date formatting libs
|
||||||
return date.toISOString().substring(0, 10);
|
let day = ("0" + (date.getDate())).slice(-2);
|
||||||
|
let month = ("0" + (date.getMonth() + 1)).slice(-2);
|
||||||
|
return `${date.getFullYear()}-${month}-${day}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDateForAngular(dateStr) {
|
function formatDateForAngular(dateStr) {
|
||||||
|
@ -45,8 +45,7 @@ define(['angular', 'lodash'], (angular, _) => {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "day":
|
case "day":
|
||||||
// +2 because date is 0 based in JS dates but 1 based in the API
|
newDate.setDate(date.getDate() + 1);
|
||||||
newDate.setDate(date.getDate() + 2);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user