-
Notifications
You must be signed in to change notification settings - Fork 1
Added Date filter and display to search #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SaffatHasan
wants to merge
2
commits into
master
Choose a base branch
from
add-date-to-search
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/main/java/edu/drexel/TrainDemo/trips/models/entities/CalendarEntity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package edu.drexel.TrainDemo.trips.models.entities; | ||
|
|
||
| import javax.persistence.Entity; | ||
| import javax.persistence.GeneratedValue; | ||
| import javax.persistence.GenerationType; | ||
| import javax.persistence.Id; | ||
|
|
||
| @Entity(name = "calendar") | ||
| public class CalendarEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.AUTO) | ||
| private Long id; | ||
| private boolean monday; | ||
| private boolean tuesday; | ||
| private boolean wednesday; | ||
| private boolean thursday; | ||
| private boolean friday; | ||
| private boolean saturday; | ||
| private boolean sunday; | ||
| // private Date startDate; | ||
| // private Date endDate; | ||
|
|
||
| protected CalendarEntity() { | ||
| } | ||
|
|
||
| public CalendarEntity(boolean monday, | ||
| boolean tuesday, | ||
| boolean wednesday, | ||
| boolean thursday, | ||
| boolean friday, | ||
| boolean saturday, | ||
| boolean sunday) { | ||
| this.monday = monday; | ||
| this.tuesday = tuesday; | ||
| this.wednesday = wednesday; | ||
| this.thursday = thursday; | ||
| this.friday = friday; | ||
| this.saturday = saturday; | ||
| this.sunday = sunday; | ||
| } | ||
|
|
||
|
|
||
| public boolean isMonday() { | ||
| return monday; | ||
| } | ||
|
|
||
| public boolean isTuesday() { | ||
| return tuesday; | ||
| } | ||
|
|
||
| public boolean isWednesday() { | ||
| return wednesday; | ||
| } | ||
|
|
||
| public boolean isThursday() { | ||
| return thursday; | ||
| } | ||
|
|
||
| public boolean isFriday() { | ||
| return friday; | ||
| } | ||
|
|
||
| public boolean isSaturday() { | ||
| return saturday; | ||
| } | ||
|
|
||
| public boolean isSunday() { | ||
| return sunday; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "Calendar{" + | ||
| "id=" + id + | ||
| ", monday=" + monday + | ||
| ", tuesday=" + tuesday + | ||
| ", wednesday=" + wednesday + | ||
| ", thursday=" + thursday + | ||
| ", friday=" + friday + | ||
| ", saturday=" + saturday + | ||
| ", sunday=" + sunday + | ||
| '}'; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,32 @@ | |
| <html xmlns:th="https://www.thymeleaf.org"> | ||
| <head> | ||
| <th:block th:replace="base :: header"/> | ||
| <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | ||
| <script src="https://code.jquery.com/jquery-1.12.4.js"></script> | ||
| <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | ||
| </head> | ||
| <body> | ||
| <th:block th:replace="base :: navbar"/> | ||
| <h1>Search Trips</h1> | ||
| <!--/*@thymesVar id="TripSearchRequest" type="edu.drexel.TrainDemo.trips.models.TripSearchRequest"*/--> | ||
|
|
||
| <!--<h4 id="selectedDateVal"></h4>--> | ||
| <script> | ||
| $( function() { | ||
| $.datepicker.setDefaults({ | ||
| onClose:function(date, inst){ | ||
| $("#selectedDateVal").html(date); | ||
| } | ||
| }); | ||
|
|
||
| $( "#datepicker" ).datepicker(); | ||
| }); | ||
| </script> | ||
|
|
||
| <form action="#" id="userProfileForm" method="post" th:action="@{/trips/search/submit}" | ||
| th:object="${TripSearchRequest}"> | ||
| <label>Departure Date: <input type="text" id="datepicker" th:field="*{date}"></label> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does something like |
||
| <br/> | ||
| <label>From</label> | ||
| <select th:field="*{from}"> | ||
| <option value="">Select From</option> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this code into the constructor of Itinerary instead?