Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20230403
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
20230403
Commits
25a303e7
Commit
25a303e7
authored
Apr 24, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bardzo prosty szablon do wyświetlania czasu
parent
b31b0eb0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
.gitignore
.gitignore
+2
-0
TimeController.java
...Spring/src/main/java/com/example/demo/TimeController.java
+8
-0
wyswietl_czas5.html
PC26-Spring/src/main/resources/templates/wyswietl_czas5.html
+12
-0
No files found.
.gitignore
View file @
25a303e7
...
...
@@ -4,6 +4,8 @@
/RemoteSystemsTempFiles/
/Servers/
/local/
/.sonarlint/
# w razie gdyby ktos zaimportowal cale repo jako projekt
/.project
...
...
PC26-Spring/src/main/java/com/example/demo/TimeController.java
View file @
25a303e7
...
...
@@ -6,6 +6,7 @@ import java.time.format.DateTimeFormatter;
import
java.util.Locale
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
...
@@ -53,4 +54,11 @@ public class TimeController {
dt
.
toLocalTime
(),
dt
.
toLocalDate
(),
dt
.
format
(
FORMAT_DATY
));
}
@RequestMapping
(
"/time5"
)
public
String
time5
(
Model
model
)
{
LocalDateTime
dateTime
=
LocalDateTime
.
now
();
model
.
addAttribute
(
"dt"
,
dateTime
);
return
"wyswietl_czas5.html"
;
}
}
PC26-Spring/src/main/resources/templates/wyswietl_czas5.html
0 → 100644
View file @
25a303e7
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Która godzina
</title>
</head>
<body>
<p>
Data i czas: [[${dt}]].
</p>
<p>
Dzisiaj mamy [[${dt.dayOfYear}]] dzień roku [[${dt.year}]].
</p>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment