Commit 913fd01
committed
Parse domain expiry as a date-only string after the wordpress-rs 0.6.0 bump
`AllDomainItem.expiry` changed from `Option<WpGmtDateTime>` (`java.util.Date`
in Kotlin) to `Option<WpDateString>` (`String`), because `/all-domains/`
returns expiry as a date-only `"YYYY-MM-DD"` value rather than a full
datetime.
Parse it with `LocalDate.parse` instead of converting a `Date` through the
system time zone, and drop the now-unused `asLegacyDate` preview helper.
`WpDateString` carries the raw API string with no format validation, so the
parse is wrapped in `runCatching` and falls back to no expiry.1 parent a1d1201 commit 913fd01
2 files changed
Lines changed: 6 additions & 14 deletions
File tree
- WordPress/src/main/java/org/wordpress/android/ui/domains/management
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
168 | 166 | | |
169 | 167 | | |
170 | 168 | | |
171 | | - | |
| 169 | + | |
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
| |||
185 | 183 | | |
186 | 184 | | |
187 | 185 | | |
188 | | - | |
189 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| |||
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
120 | 117 | | |
121 | 118 | | |
122 | 119 | | |
123 | | - | |
| 120 | + | |
124 | 121 | | |
125 | 122 | | |
126 | 123 | | |
| |||
156 | 153 | | |
157 | 154 | | |
158 | 155 | | |
159 | | - | |
| 156 | + | |
160 | 157 | | |
161 | 158 | | |
162 | 159 | | |
| |||
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
0 commit comments