You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User posts now include the date it was submitted.
The layout for each post has also been changed
to account for the date.
Changes made drumstick.sql file
- added created_on column of type date
to posts table to automatically time stamp
a date for a post when created.
Changes made to posts.go file
Changes made to the post struct
- Added createdOn field of type time.Time
to map to the the same field in the posts table
- Added the date string field to store the date as a formatted
string. This allows the date to be viewed via the posts template file
- Changes made to usernameByID func
- added logic to format the date in usernameByID func
to store the date as a string in the post.Date field
- Changes made to CreatePosts func
- updated fields to inlcude the createdOn field to
map to created_on column in the posts table
Changes made to posts.tmpl file
- looping through posts now shows the date
- added link to new drumstick.css file for better layout of posts elements
Changes made to main.go file
- added the echo.Static func to include the root directory path to
the static file drumstick.css file to shorten the import path for posts.tmpl.
0 commit comments