Repository: tarkah/tickrs (language: rust)

Issue:
Most recent date is wrong in candle view for longer time periods
In candle view, the right-most date displays incorrectly for the larger charts. (`1W` and up)

The 1W chart displays `01-01 01:00`:
![image](https://user-images.githubusercontent.com/1682504/108609657-a34ba400-73cf-11eb-91d5-a1ad4fe438b9.png)

The 1M+ charts display `1970-01-01`:
![image](https://user-images.githubusercontent.com/1682504/108609674-c24a3600-73cf-11eb-977d-eff8a295dd74.png)

Not sure if this might be relevant: my local timezone is `Europe/Berlin`.


Discussion / hints:
At that's 0 in unix timestamp :) I know the issue here, I'll easily be able to fix this.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd2644f..62a8700 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,11 @@ and `Removed`.
 
 ## [Unreleased]
 
+### Fixed
+
+- Fixed last x label for candlestick charts from showing unix time 0 for 1W - 5Y
+  timeframes
+
 ## [0.13.0] - 2021-02-19
 
 ### Added
diff --git a/src/widget/chart/prices_candlestick.rs b/src/widget/chart/prices_candlestick.rs
index 9055e15..50bb491 100644
--- a/src/widget/chart/prices_candlestick.rs
+++ b/src/widget/chart/prices_candlestick.rs
@@ -99,7 +99,7 @@ impl<'a> StatefulWidget for PricesCandlestickChart<'a> {
             x_area.x = layout[1].x + 1;
             x_area.width = layout[1].width - 1;
 
-            let labels = state.x_labels(area.width, start, end, &data);
+            let labels = state.x_labels(area.width, start, end, &self.data);
             let total_width = labels.iter().map(Span::width).sum::<usize>() as u16;
             let labels_len = labels.len() as u16;
             if total_width < x_area.width && labels_len > 1 {


Test patch: