Skip to content

Commit

Permalink
fix wrong date time picker value on 12PM when using 12hours format
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Feb 12, 2024
1 parent ae91927 commit 9307d9c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,45 @@ name: Deploy

on:
push:
branches: [ master , development]
branches: [ master , development, 1.0.1-RC6 ]

jobs:
verify:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
java-version: [ 8, 11 ]
java-version: [ 11 ]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Java and Maven
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
- run: mvn verify
distribution: 'temurin'
- run: ./mvnw verify -B -e

release:
needs: verify
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Java and Maven
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8

- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_args: -Dci=true
java-version: 11
distribution: 'temurin'
server-id: ossrh
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.gpg_private_key }}") | gpg --batch --import
- name: publish to snapshot
run: ./mvnw --no-transfer-progress clean deploy -B -e -Dci=true -Dgpg.passphrase=${{ secrets.gpg_passphrase }}
env:
SONATYPE_USERNAME: ${{ secrets.nexus_username }}
SONATYPE_PASSWORD: ${{ secrets.nexus_password }}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ public int getCorrectHour(int hour) {
@Override
public Date getTime() {
JsDate jsDate = new JsDate();
jsDate.setHours(DayPeriod.PM.equals(dayPeriod) ? hour + 12 : hour);
if(DayPeriod.PM.equals(dayPeriod) && hour < 12){
jsDate.setHours(hour + 12);
}else if(DayPeriod.AM.equals(dayPeriod) && hour == 12){
jsDate.setHours(0);
}else {
jsDate.setHours(hour);
}
jsDate.setMinutes(minute);
jsDate.setSeconds(second);
return new Date(new Double(jsDate.getTime()).longValue());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<properties>
<snapshot.version>HEAD-SNAPSHOT</snapshot.version>
<next.release.version>1.0.0-RC6</next.release.version>
<next.release.version>1.0.1-RC6</next.release.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

Expand Down

0 comments on commit 9307d9c

Please sign in to comment.