sbd-npm 1.4.47 → 1.4.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/stock_basics.js +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.47",
3
+ "version": "1.4.48",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/stock_basics.js CHANGED
@@ -287,9 +287,18 @@ let Stock = {
287
287
  sort_order: Stock.sort_order,
288
288
  start_date: $("#hist_start_date").val(),
289
289
  end_date: $("#hist_end_date").val(),
290
- hist_type: hist_type
290
+ hist_type: hist_type,
291
+ is_init: Stock.data.hasOwnProperty(localStorage[Stock.tab_token]) ? 1 : 0
291
292
  };
292
293
  Util.post("/stock/" + Stock["code"], payload, function (j) {
294
+ if (j["init_start_date"]) {
295
+ let init_start_date = Util.seconds_to_format(j["init_start_date"], "%Y-%m-%d");
296
+ $("#hist_start_date").val(init_start_date).data('daterangepicker').setStartDate(init_start_date);
297
+ }
298
+ if (j["init_end_date"]) {
299
+ let init_end_date = Util.seconds_to_format(j["init_end_date"], "%Y-%m-%d");
300
+ $("#hist_end_date").val(init_end_date).data('daterangepicker').setStartDate(init_end_date);
301
+ }
293
302
  Stock.hist_type = "";
294
303
  let html = [], hist_low_price = 0, hist_high_price = 0, total_amount = 0, total_volume = 0;
295
304
  j["data"].forEach(function (item) {