Index: backend/src/main/java/com/tradingmk/backend/controller/StockHistoryController.java
===================================================================
--- backend/src/main/java/com/tradingmk/backend/controller/StockHistoryController.java	(revision 473ccd2fe1b540a575f8b7ac6e13e4c957ac1973)
+++ backend/src/main/java/com/tradingmk/backend/controller/StockHistoryController.java	(revision 5da38e0479eef6bdb882e7ecd8ab13ecc14f96e3)
@@ -23,7 +23,4 @@
     @PostMapping("/upload")
     public ResponseEntity<Void> saveHistory(@RequestBody List<StockHistory> histories) {
-        for (StockHistory s : histories) {
-            System.out.println("Received: " + s.getSymbol() + ", " + s.getPrice() + ", " + s.getTimestamp());
-        }
         stockHistoryService.saveAll(histories);
         return ResponseEntity.ok().build();
Index: backend/src/main/java/com/tradingmk/backend/service/StockHistoryService.java
===================================================================
--- backend/src/main/java/com/tradingmk/backend/service/StockHistoryService.java	(revision 473ccd2fe1b540a575f8b7ac6e13e4c957ac1973)
+++ backend/src/main/java/com/tradingmk/backend/service/StockHistoryService.java	(revision 5da38e0479eef6bdb882e7ecd8ab13ecc14f96e3)
@@ -19,4 +19,5 @@
 
     public void saveAll(List<StockHistory> histories) {
+
         for (StockHistory incoming : histories) {
             StockHistory history = new StockHistory();
@@ -27,4 +28,5 @@
             stockHistoryRepository.save(history);
         }
+
     }
 
Index: frontend/src/pages/DetailedStockView/DetailedStockView.jsx
===================================================================
--- frontend/src/pages/DetailedStockView/DetailedStockView.jsx	(revision 473ccd2fe1b540a575f8b7ac6e13e4c957ac1973)
+++ frontend/src/pages/DetailedStockView/DetailedStockView.jsx	(revision 5da38e0479eef6bdb882e7ecd8ab13ecc14f96e3)
@@ -1,5 +1,5 @@
 import React, {useEffect, useState} from 'react';
-import { LineChart, Line, XAxis, YAxis, ResponsiveContainer } from 'recharts';
-import { TrendingUp, Settings, Search, RotateCcw } from 'lucide-react';
+import {LineChart, Line, XAxis, YAxis, ResponsiveContainer} from 'recharts';
+import {TrendingUp, Settings, Search, RotateCcw} from 'lucide-react';
 import Menu from "../Menu/Menu.jsx";
 import {useParams} from "react-router-dom";
@@ -7,16 +7,25 @@
 const DetailedStockView = () => {
     const [selectedTimeframe, setSelectedTimeframe] = useState('1m');
-    const { symbol } = useParams();
+    const {symbol} = useParams();
     const [chartData, setChartData] = useState([]);
     const [currentPrice, setCurrentPrice] = useState(null);
-    const [percentage,setPercentage] = useState(null);
+    const [percentage, setPercentage] = useState(null);
 
     useEffect(() => {
-        if (!symbol) return;
-
-        const from = '2025-05-26';
-        const to = '2025-06-20';
-
-        fetch(`http://localhost:8080/api/history/${symbol}?from=${from}&to=${to}`)
+        if (!symbol || !selectedTimeframe) return;
+
+        let from, to;
+        const now = new Date();
+
+        if (selectedTimeframe === '1w') {
+            from = new Date(now);
+            from.setDate(now.getDate() - 7); //1week
+            to = now;
+        } else if (selectedTimeframe === '1m') {
+            from = new Date(now);
+            from.setMonth(now.getMonth() - 1); // 1month
+            to = now;
+        }
+        fetch(`http://localhost:8080/api/history/${symbol}?from=${from.toISOString().split('T')[0]}&to=${to.toISOString().split('T')[0]}`)
             .then(res => res.json())
             .then(data => {
@@ -34,5 +43,5 @@
             })
             .catch(err => console.error("Error fetching current price:", err));
-    }, [symbol]);
+    }, [symbol,selectedTimeframe]);
 
 
@@ -70,5 +79,5 @@
                         </div>
                         <div className="flex items-center space-x-4">
-                            <TrendingUp className="w-5 h-5 text-gray-400" />
+                            <TrendingUp className="w-5 h-5 text-gray-400"/>
                         </div>
                     </div>
@@ -78,12 +87,14 @@
                         <div className="flex items-baseline space-x-4">
                             <span className="text-4xl font-bold">{currentPrice}</span>
-                            <span className={`${percentage < 0 ? 'text-red-400' : percentage > 0 ? 'text-green-400' : 'text-gray-200'} font-medium`}>{percentage}</span>
-                        </div>
-                    </div>
-
+                            <span
+                                className={`${percentage < 0 ? 'text-red-400' : percentage > 0 ? 'text-green-400' : 'text-gray-200'} font-medium`}>
+    {percentage !== null ? `${percentage} %` : ''}
+</span>
+                        </div>
+                    </div>
 
 
                     <div className="flex space-x-4 mb-6">
-                        {['24h', '1w', '1m'].map((timeframe) => (
+                        {[ '1w', '1m'].map((timeframe) => (
                             <button
                                 key={timeframe}
@@ -108,5 +119,5 @@
                                     axisLine={false}
                                     tickLine={false}
-                                    tick={{ fill: '#6B7280', fontSize: 12 }}
+                                    tick={{fill: '#6B7280', fontSize: 12}}
                                 />
                                 <YAxis
@@ -114,5 +125,5 @@
                                     axisLine={false}
                                     tickLine={false}
-                                    tick={{ fill: '#6B7280', fontSize: 12 }}
+                                    tick={{fill: '#6B7280', fontSize: 12}}
                                 />
                                 <Line
@@ -122,5 +133,5 @@
                                     strokeWidth={2}
                                     dot={false}
-                                    activeDot={{ r: 4, stroke: '#10B981', strokeWidth: 2 }}
+                                    activeDot={{r: 4, stroke: '#10B981', strokeWidth: 2}}
                                 />
                             </LineChart>
@@ -166,8 +177,8 @@
 
 
-                    <button className="w-full bg-gradient-to-r from-green-400 to-blue-500 text-white py-3 rounded-lg font-medium mb-4">
+                    <button
+                        className="w-full bg-gradient-to-r from-green-400 to-blue-500 text-white py-3 rounded-lg font-medium mb-4">
                         Buy
                     </button>
-
 
 
