Skip to content

Commit

Permalink
Jay STAR-9277 datetime format pattern (#53)
Browse files Browse the repository at this point in the history
* datetime format pattern

* bump version
  • Loading branch information
JiaweiChen110 authored Nov 15, 2024
1 parent c4bc547 commit aec7810
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:

# Docker Build
- name: "gcr.io/cloud-builders/docker:20.10.14"
args: ["build", "-t", "${_ARTIFACT_REGISTRY_REPO}/tide:3.0.36${_SUFFIX}", "."]
args: ["build", "-t", "${_ARTIFACT_REGISTRY_REPO}/tide:3.0.37${_SUFFIX}", "."]

# Docker push to Google Artifact Registry
- name: "gcr.io/cloud-builders/docker:20.10.14"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ public class DateAnonymizer implements AnonymizerProcessor {
Pattern.compile(PRECEDING + MONTH + "\\s+" + DAY + DAY_SUFFIX + "?\\b",
Pattern.CASE_INSENSITIVE),
TEST ? "<span style=\"color:red\">&lt;$0&gt;</span>" : "${month}/${day}"
},
// 2008-08-09T15:11:00
{
Pattern.compile(PRECEDING + YEAR + "(/|-)" + MON + "\\2" + DAY + "(T?:\\s*" + TIME + ")?",
Pattern.CASE_INSENSITIVE),
TEST ? "<span style=\"color:red\">&lt;$0&gt;</span>" : "${month}/${day}/${year}"
},
// 20080809151100
{
Pattern.compile(PRECEDING + YEAR + MON + DAY + "(?:\\s*" + TIME + ")?",
Pattern.CASE_INSENSITIVE),
TEST ? "<span style=\"color:red\">&lt;$0&gt;</span>" : "${month}/${day}/${year}"
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public class DateAnonymizerTest {
"Mar 4, 2014 18:00h",
"4/2/2010 5/2/2014 6-4-14 march 10th, 2010",
"May 10", // Was not originally handled
"DOB: 12/31/2000LOC: ABC" //when connects to surrounding
"DOB: 12/31/2000LOC: ABC", //when connects to surrounding
"2008-08-09T15:11:00",
"20080809151100"
};

static String[] negativeTests = new String[]{
Expand Down

0 comments on commit aec7810

Please sign in to comment.