Last active
April 7, 2016 18:19
-
-
Save JacAbreu/75ab3913cbd9db5ab08d41b256f063b8 to your computer and use it in GitHub Desktop.
Está bonito?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def createdAtFormatted | |
def dateCreated = ticket?.getCreatedAt() | |
try { | |
createdAtFormatted = format?.format(dateCreated) | |
} catch (Exception e) { | |
try { | |
def dateCreatedDate = format?.parse(dateCreated) | |
createdAtFormatted = format?.format(dateCreatedDate) | |
} catch (Exception ex) { | |
def formatDateComplete = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH); | |
formatDateComplete.setTimeZone(TimeZone.getTimeZone("BRT")); | |
createdAtFormatted = formatDateComplete.parse(dateCreated) | |
createdAtFormatted = format.format(createdAtFormatted) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment