Incorrect date is shown in Processing Period creating and list components

Description

While working on OLMIS-6188, I noticed that the problem with dates is not only with creating form but also with list view.

After quick research and debugging section while working on i found that the main problem is with date's converting process.
Dates are converted to ISO format with timezone which set them back one day. We don't want a situation when processing period's date is affected by timezone.

Possible solution to the problem may be to write a separate function for processing periods in date's utils in openlmis-ui-components.

Reproduction steps

  1. Go to Administration->Processing Schedules and click Edit Button.

  2. The back-end response for this action is:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 { "content" : [ { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Jan2017", "startDate" : "2017-01-01", "endDate" : "2017-01-31", "durationInMonths" : 1, "extraData" : { }, "id" : "516ac930-0d28-49f5-a178-64764e22b236" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Feb2017", "startDate" : "2017-02-01", "endDate" : "2017-02-28", "durationInMonths" : 1, "extraData" : { }, "id" : "04ec3c83-a086-4792-b7a3-c46559b7f6cd" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Mar2017", "startDate" : "2017-03-01", "endDate" : "2017-03-31", "durationInMonths" : 1, "extraData" : { }, "id" : "61694e82-1be6-40a4-9aaa-bfbb720a0d7d" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Apr2017", "startDate" : "2017-04-01", "endDate" : "2017-04-30", "durationInMonths" : 1, "extraData" : { }, "id" : "c9287c65-67fa-4958-adb6-52069f2b1379" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "May2017", "startDate" : "2017-05-01", "endDate" : "2017-05-31", "durationInMonths" : 1, "extraData" : { }, "id" : "2d490229-02f8-4235-9be4-1443fd8f7b4f" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Jun2017", "startDate" : "2017-06-01", "endDate" : "2017-06-30", "durationInMonths" : 1, "extraData" : { }, "id" : "a91dfbdf-0d9b-4cb1-9d46-0a47b17d22d0" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Jul2017", "startDate" : "2017-07-01", "endDate" : "2017-07-31", "durationInMonths" : 1, "extraData" : { }, "id" : "f55d9dda-d440-40c0-a793-914e0fe1f579" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Aug2017", "startDate" : "2017-08-01", "endDate" : "2017-08-31", "durationInMonths" : 1, "extraData" : { }, "id" : "ecd6c3c8-f80c-4c4e-af9a-d0529b55424a" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Sep2017", "startDate" : "2017-09-01", "endDate" : "2017-09-30", "durationInMonths" : 1, "extraData" : { }, "id" : "c08e1295-793f-4550-933b-571e117f15d9" }, { "processingSchedule" : { "id" : "9c15bd6e-3f6b-4b91-b53a-36c199d35eac", "code" : "SCH001", "name" : "Monthly" }, "name" : "Oct2017", "startDate" : "2017-10-01", "endDate" : "2017-10-31", "durationInMonths" : 1, "extraData" : { }, "id" : "2a9fddb6-5dd3-4dde-81f3-c19629257986" } ], "last" : false, "totalElements" : 108, "totalPages" : 11, "sort" : [ { "direction" : "ASC", "property" : "startDate", "ignoreCase" : false, "nullHandling" : "NATIVE", "descending" : false, "ascending" : true } ], "first" : true, "numberOfElements" : 10, "size" : 10, "number" : 0 }

However, in the creating form and periods list, dates are set back one day.

EXPECTED RESULT

  • The processing period's start date and all dates visible on the UI should match the dates on the back-end.

Environment

None

Status

Assignee

Aleksandra Sołtys

Reporter

Mateusz Wedeł

Labels

Story Points

3

Time tracking

28h

Components

Sprint

None

Fix versions

Priority

Major
Configure