Skip to content

Commit c18ea79

Browse files
committed
Adding the possibility to use 24h notation in the search filter of the message browser and the event browser.
Frederik De Kegel <frederik@ghoti.be> Signed-off-by: UZ Brussel <integraties.informatica@uzbrussel.be>
1 parent 7e46aec commit c18ea79

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

client/src/com/mirth/connect/client/ui/browsers/event/EventBrowser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public class EventBrowser extends javax.swing.JPanel {
9595
private Map<Integer, String> userMapById = new LinkedHashMap<Integer, String>();
9696
private SwingWorker<Void, Void> worker;
9797

98+
//providing 24h notation in the filter
9899
private Boolean use24hourNotation = true;
99100
/**
100101
* Constructs the new event browser and sets up its default information/layout.

client/src/com/mirth/connect/client/ui/browsers/message/MessageBrowser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public class MessageBrowser extends javax.swing.JPanel {
172172

173173
private List<Integer> selectedMetaDataIds;
174174

175+
//providing 24h notation in the filter
175176
private Boolean use24hourNotation = true;
176177

177178
/**

client/src/com/mirth/connect/client/ui/components/MirthTimePicker.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public MirthTimePicker(String format, int accuracy) {
4949
public void init(String format, int accuracy) {
5050
this.parent = PlatformUI.MIRTH_FRAME;
5151

52+
//removed the simple date format and replaced with a function to format the date, see below
5253
//SimpleDateFormat dateFormat = new SimpleDateFormat(format);
5354
GregorianCalendar calendar = new GregorianCalendar();
5455
Date now = calendar.getTime();
@@ -70,6 +71,7 @@ public void keyPressed(KeyEvent e) {
7071
public void keyReleased(KeyEvent e) {}
7172
});
7273

74+
//Replace the default formatter by a function that uses the given format
7375
/*DefaultFormatterFactory factory = (DefaultFormatterFactory) tf.getFormatterFactory();
7476
formatter = (DateFormatter) factory.getDefaultFormatter();
7577
formatter.setFormat(dateFormat);
@@ -86,6 +88,12 @@ public void stateChanged(ChangeEvent event) {
8688
});
8789
}
8890

91+
/**
92+
* Sets the format string used by the DateFormatter used by this time picker.
93+
*
94+
* @param formatString
95+
* the format string to use
96+
*/
8997
public void setFormatter(String formatString) {
9098
SimpleDateFormat dateFormat = new SimpleDateFormat(formatString);
9199
JFormattedTextField tf = ((JSpinner.DefaultEditor) getEditor()).getTextField();

0 commit comments

Comments
 (0)