Compare commits

..

2 Commits

4 changed files with 18 additions and 10 deletions

View File

@@ -23,9 +23,9 @@ public class PointEngine {
DATE, DATE,
} }
static final Pattern DOW_PATTERN = Pattern.compile("dow=(sun|mon|tue|wed|thu|fri|sat) (\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE); static final Pattern DOW_PATTERN = Pattern.compile("dow=(sun|mon|tue|wed|thu|fri|sat)\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
static final Pattern MONTH_PATTERN = Pattern.compile("m=(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE); static final Pattern MONTH_PATTERN = Pattern.compile("m=(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
static final Pattern DATE_PATTERN = Pattern.compile("(\\d{4}-\\d{2}-\\d{2}) (\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE); static final Pattern DATE_PATTERN = Pattern.compile("(\\d{4}-\\d{2}-\\d{2})\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
private RuleType type; private RuleType type;
private DayOfWeek dow; private DayOfWeek dow;
@@ -77,7 +77,7 @@ public class PointEngine {
} }
public void importPointsFile(File pointsFile) { public void importPointsFile(File pointsFile) {
Pattern defaultPattern = Pattern.compile("default (\\d+\\.\\d+)"); Pattern defaultPattern = Pattern.compile("default\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
try (BufferedReader br = new BufferedReader(new FileReader(pointsFile))) { try (BufferedReader br = new BufferedReader(new FileReader(pointsFile))) {
String line; String line;

View File

@@ -3,9 +3,9 @@ package net.themusicinnoise.vaccalc;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.io.BufferedReader; import java.io.*;
import java.io.InputStreamReader;
import java.time.YearMonth; import java.time.YearMonth;
import java.util.Properties;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class VacCalc extends JFrame { public class VacCalc extends JFrame {
@@ -72,10 +72,17 @@ public class VacCalc extends JFrame {
@Override @Override
public void actionPerformed(ActionEvent ev) { public void actionPerformed(ActionEvent ev) {
BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("about.html"))); BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("about.html")));
Properties properties = new Properties();
try {
properties.load(getClass().getClassLoader().getResourceAsStream("project.properties"));
} catch (IOException e) {
System.err.println("Failed to load project properties.");
e.printStackTrace();
}
String aboutText = br.lines().collect(Collectors.joining()); String aboutText = br.lines().collect(Collectors.joining());
JOptionPane.showMessageDialog(VacCalc.this, aboutText = aboutText.replace("VERSION", properties.getProperty("version"));
aboutText, JOptionPane.showMessageDialog(VacCalc.this, aboutText, "About",
"About", JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} }
}); });
helpMenu.add(aboutItem); helpMenu.add(aboutItem);

View File

@@ -1,5 +1,5 @@
<html> <html>
<p><b>VacCalc v1.0.0</b></p> <p><b>VacCalc VERSION</b></p>
<hr /> <hr />
<p>Copyright &copy; 2026 Nicolás A. Ortega Froysa &lt;nicolas@ortegas.org&gt;</p> <p>Copyright &copy; 2026 Nicolás A. Ortega Froysa &lt;nicolas@ortegas.org&gt;</p>
<p>License: Zlib</p> <p>License: Zlib</p>

View File

@@ -0,0 +1 @@
version=${project.version}