Skip to content

Commit 4a0e05b

Browse files
author
isayan
committed
日付の変換方法を変更
1 parent 42512c0 commit 4a0e05b

File tree

9 files changed

+197
-120
lines changed

9 files changed

+197
-120
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ dependencies {
9191
// https://mvnrepository.com/artifact/com.googlecode.juniversalchardet/juniversalchardet
9292
implementation 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
9393

94+
// standalone 利用のため
9495
// https://mvnrepository.com/artifact/net.portswigger.burp.extender/burp-extender-api
95-
compileOnly 'net.portswigger.burp.extender:burp-extender-api:2.3'
96+
implementation 'net.portswigger.burp.extender:burp-extender-api:2.3'
9697
// https://mvnrepository.com/artifact/commons-codec/commons-codec
9798
implementation 'commons-codec:commons-codec:1.15'
9899
// https://mvnrepository.com/artifact/com.fifesoft/rsyntaxtextarea

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
netbeans.org-netbeans-modules-javascript2-requirejs.enabled=true
22
release_version_major=2.2
3-
release_version_minor=13.4
3+
release_version_minor=13.5

help/help-ja.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,7 @@ <h3 id="_version">2.9. Version</h3>
20712071
</div>
20722072
<div id="footer">
20732073
<div id="footer-text">
2074-
Last updated 2022-05-16 08:12:08 +0900
2074+
Last updated 2022-05-31 19:32:19 +0900
20752075
</div>
20762076
</div>
20772077
</body>

help/help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ <h3 id="_version">2.9. Version</h3>
20972097
</div>
20982098
<div id="footer">
20992099
<div id="footer-text">
2100-
Last updated 2022-05-16 08:12:08 +0900
2100+
Last updated 2022-05-31 19:32:19 +0900
21012101
</div>
21022102
</div>
21032103
</body>

release/YaguraExtender-v2.2.jar

18.6 KB
Binary file not shown.

src/main/java/extend/util/external/TransUtil.java

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616
import java.nio.charset.StandardCharsets;
1717
import java.text.DecimalFormat;
1818
import java.time.LocalDate;
19+
import java.time.LocalDateTime;
20+
import java.time.LocalTime;
1921
import java.time.format.DateTimeFormatter;
2022
import java.time.temporal.ChronoUnit;
2123
import java.util.ArrayList;
2224
import java.util.Arrays;
25+
import java.util.Calendar;
26+
import java.util.Date;
27+
import java.util.GregorianCalendar;
2328
import java.util.HashMap;
2429
import java.util.List;
2530
import java.util.TimeZone;
@@ -1372,7 +1377,7 @@ public static String toHtmlByteHexEncode(byte[] bytes, Pattern pattern, boolean
13721377
}
13731378
return buff.toString();
13741379
}
1375-
1380+
13761381
public static String toHtmlDecode(String input) {
13771382
StringBuffer buff = new StringBuffer();
13781383
Pattern p = Pattern.compile("(&(?:(#\\d+)|(#[xX][0-9a-fA-F]+)|(\\w+));)");
@@ -1571,7 +1576,7 @@ private static String toRadixTrim(String value) {
15711576
}
15721577
return value;
15731578
}
1574-
1579+
15751580
private final static Pattern PTN_JS_META = Pattern.compile("(\\\\[rnbftv\\\\])|(\\\\x[0-9a-fA-F]{2})|((\\\\u[dD][89abAB][0-9a-fA-F]{2}\\\\u[dD][c-fC-F][0-9a-fA-F]{2})|(\\\\u[0-9a-fA-F]{4}))");
15761581

15771582
/**
@@ -1670,7 +1675,7 @@ public static String decodeStandardLangMeta(String input) {
16701675
private final static Pattern PTN_STANDARD_ENCODE_META = Pattern.compile("([\r\n\t])");
16711676
/**
16721677
* 標準言語形式のメタ文字エンコード(エスケープする)
1673-
*
1678+
*
16741679
* @param value
16751680
* @return エンコードされた値
16761681
*/
@@ -1697,7 +1702,7 @@ public static String encodeStandardLangMeta(String input) {
16971702
m.appendTail(buff);
16981703
return buff.toString();
16991704
}
1700-
1705+
17011706
public static String toRegexEncode(String value, boolean metachar) {
17021707
String encode = value;
17031708
if (metachar) {
@@ -2305,8 +2310,28 @@ public static BigDecimal toExcelSerial(long epoch_milli) {
23052310
}
23062311

23072312
private final static String ORDERD_CHAR = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
2308-
2313+
23092314
public static char getOrderdChar(int ord) {
23102315
return ORDERD_CHAR.charAt(ord % ORDERD_CHAR.length());
2311-
}
2316+
}
2317+
2318+
/*
2319+
* DateへはZoneがデフォルトのZoneになるため強制的に変更
2320+
*/
2321+
public static Date toZoneWithDate(LocalDateTime ldtm) {
2322+
GregorianCalendar cal = new GregorianCalendar(ldtm.getYear(), ldtm.getMonthValue(), ldtm.getDayOfMonth(), ldtm.getHour(), ldtm.getMinute(), ldtm.getSecond());
2323+
return cal.getTime();
2324+
}
2325+
2326+
/*
2327+
* DateへはZoneが
2328+
*/
2329+
public static LocalDateTime toZoneWithLocalDate(Date date) {
2330+
Calendar cal = GregorianCalendar.getInstance();
2331+
cal.setTime(date);
2332+
LocalDateTime ldtm = LocalDateTime.of(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
2333+
return ldtm;
2334+
}
2335+
2336+
23122337
}

src/main/java/yagura/view/JTransCoderTab.form

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,20 +2428,20 @@
24282428
<Group type="103" groupAlignment="0" attributes="0">
24292429
<Group type="102" alignment="0" attributes="0">
24302430
<EmptySpace max="-2" attributes="0"/>
2431-
<Group type="103" groupAlignment="0" max="-2" attributes="0">
2432-
<Component id="lblZoneDate" max="32767" attributes="0"/>
2431+
<Group type="103" groupAlignment="0" attributes="0">
24332432
<Component id="lblJavaSerial" alignment="0" max="32767" attributes="0"/>
2434-
<Component id="lblExcelSerial" alignment="1" max="32767" attributes="0"/>
2433+
<Component id="lblZoneDate" max="32767" attributes="0"/>
2434+
<Component id="lblDate" alignment="0" pref="76" max="32767" attributes="0"/>
24352435
<Component id="lblUnixtime" alignment="0" max="32767" attributes="0"/>
2436-
<Component id="lblDate" alignment="0" max="32767" attributes="0"/>
2436+
<Component id="lblExcelSerial" alignment="0" max="32767" attributes="0"/>
24372437
</Group>
2438-
<EmptySpace type="unrelated" max="-2" attributes="0"/>
2438+
<EmptySpace max="-2" attributes="0"/>
24392439
<Group type="103" groupAlignment="0" attributes="0">
24402440
<Component id="txtUnixtime" alignment="0" max="32767" attributes="0"/>
24412441
<Component id="txtJavaSerial" alignment="0" max="32767" attributes="0"/>
24422442
<Component id="txtExcelSerial" alignment="0" max="32767" attributes="0"/>
2443-
<Component id="spnDatetime" alignment="0" pref="300" max="32767" attributes="0"/>
2444-
<Component id="txtZoneDate" alignment="0" max="32767" attributes="0"/>
2443+
<Component id="spnZoneDateTime" alignment="0" pref="290" max="32767" attributes="0"/>
2444+
<Component id="txtSystemZoneDate" alignment="0" max="32767" attributes="0"/>
24452445
</Group>
24462446
<EmptySpace max="-2" attributes="0"/>
24472447
<Group type="103" groupAlignment="0" attributes="0">
@@ -2459,18 +2459,16 @@
24592459
<Group type="103" groupAlignment="0" attributes="0">
24602460
<Group type="102" alignment="0" attributes="0">
24612461
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
2462-
<Group type="103" groupAlignment="0" attributes="0">
2463-
<Component id="lblDate" min="-2" max="-2" attributes="0"/>
2464-
<Group type="103" groupAlignment="3" attributes="0">
2465-
<Component id="spnDatetime" alignment="3" min="-2" max="-2" attributes="0"/>
2466-
<Component id="cmbTimezone" alignment="3" min="-2" max="-2" attributes="0"/>
2467-
</Group>
2462+
<Group type="103" groupAlignment="3" attributes="0">
2463+
<Component id="spnZoneDateTime" alignment="3" min="-2" max="-2" attributes="0"/>
2464+
<Component id="cmbTimezone" alignment="3" min="-2" max="-2" attributes="0"/>
2465+
<Component id="lblZoneDate" min="-2" max="-2" attributes="0"/>
24682466
</Group>
24692467
<EmptySpace max="-2" attributes="0"/>
24702468
<Group type="103" groupAlignment="3" attributes="0">
2471-
<Component id="lblZoneDate" alignment="3" min="-2" max="-2" attributes="0"/>
2469+
<Component id="lblDate" alignment="3" min="-2" max="-2" attributes="0"/>
24722470
<Component id="btnZoneDateCopy" alignment="3" min="-2" max="-2" attributes="0"/>
2473-
<Component id="txtZoneDate" alignment="3" min="-2" max="-2" attributes="0"/>
2471+
<Component id="txtSystemZoneDate" alignment="3" min="-2" max="-2" attributes="0"/>
24742472
</Group>
24752473
<EmptySpace max="-2" attributes="0"/>
24762474
<Group type="103" groupAlignment="0" attributes="0">
@@ -2537,12 +2535,12 @@
25372535
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcelSerialActionPerformed"/>
25382536
</Events>
25392537
</Component>
2540-
<Component class="javax.swing.JLabel" name="lblDate">
2538+
<Component class="javax.swing.JLabel" name="lblZoneDate">
25412539
<Properties>
2542-
<Property name="text" type="java.lang.String" value="Date:"/>
2540+
<Property name="text" type="java.lang.String" value="ZoneDate:"/>
25432541
</Properties>
25442542
</Component>
2545-
<Component class="javax.swing.JSpinner" name="spnDatetime">
2543+
<Component class="javax.swing.JSpinner" name="spnZoneDateTime">
25462544
<Properties>
25472545
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
25482546
<SpinnerModel initial="now" stepSize="5" type="date"/>
@@ -2560,9 +2558,6 @@
25602558
</Property>
25612559
<Property name="requestFocusEnabled" type="boolean" value="false"/>
25622560
</Properties>
2563-
<Events>
2564-
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnDatetimeStateChanged"/>
2565-
</Events>
25662561
</Component>
25672562
<Component class="javax.swing.JComboBox" name="cmbTimezone">
25682563
<Properties>
@@ -2634,9 +2629,9 @@
26342629
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtUnixtimeFocusLost"/>
26352630
</Events>
26362631
</Component>
2637-
<Component class="javax.swing.JLabel" name="lblZoneDate">
2632+
<Component class="javax.swing.JLabel" name="lblDate">
26382633
<Properties>
2639-
<Property name="text" type="java.lang.String" value="ZoneDate:"/>
2634+
<Property name="text" type="java.lang.String" value="Date(+0000):"/>
26402635
</Properties>
26412636
</Component>
26422637
<Component class="javax.swing.JButton" name="btnZoneDateCopy">
@@ -2647,7 +2642,7 @@
26472642
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnZoneDateCopyActionPerformed"/>
26482643
</Events>
26492644
</Component>
2650-
<Component class="javax.swing.JTextField" name="txtZoneDate">
2645+
<Component class="javax.swing.JTextField" name="txtSystemZoneDate">
26512646
<Properties>
26522647
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
26532648
<Dimension value="[180, 22]"/>

0 commit comments

Comments
 (0)