-
-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…se-timezone #95 allow user to choose timezone
- Loading branch information
Showing
13 changed files
with
112 additions
and
62 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
language: groovy | ||
|
||
jdk: | ||
- openjdk7 | ||
|
||
before_install: | ||
- sudo add-apt-repository -y ppa:groovy-dev/grails | ||
- sudo apt-get update | ||
- sudo apt-get install grails-1.3.9 | ||
|
||
script: "grails test-app unit: --non-interactive" | ||
script: 'grails test-app unit: --non-interactive' | ||
cache: | ||
directories: | ||
- "$HOME/.grails" | ||
- "$HOME/.ivy2" | ||
notifications: | ||
slack: | ||
secure: NJ2bhtLK2Xn0vPfq/lAxehuwLshp50Uep1mHMTbiQ7WK/YxNhLbrjgIbh9ZcM/UxZ4AhYX3Wv4VUI9iyEa06XUNTtxaM3ia8Eqao1wTVMl9N0RvU+VgHINORmyZZlf4MNBOZItwsmZT2b094gAfPIg7r8VuCo1wVqGjubVfTeUQ= |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog xmlns="http:https://www.liquibase.org/xml/ns/dbchangelog/1.9" | ||
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http:https://www.liquibase.org/xml/ns/dbchangelog/1.9 http:https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> | ||
<changeSet author="jmiranda (generated)" id="1442206717583-1"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<columnExists tableName="user" columnName="timezone"/> | ||
</not> | ||
</preConditions> | ||
<addColumn tableName="user"> | ||
<column name="timezone" type="VARCHAR(255)"> | ||
<constraints nullable="true" /> | ||
</column> | ||
</addColumn> | ||
</changeSet> | ||
</databaseChangeLog> |
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
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
17 changes: 17 additions & 0 deletions
17
grails-app/taglib/org/pih/warehouse/FormatDateTagLib.groovy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.pih.warehouse | ||
|
||
import org.codehaus.groovy.grails.plugins.web.taglib.FormatTagLib | ||
|
||
class FormatDateTagLib extends FormatTagLib { | ||
|
||
static namespace = "g" | ||
|
||
def formatDate = { attrs, body -> | ||
log.info "Date format: " + attrs | ||
FormatTagLib formatTagLib = grailsApplication.mainContext.getBean('org.codehaus.groovy.grails.plugins.web.taglib.FormatTagLib') | ||
if (session.timezone) { | ||
attrs.timeZone = session.timezone | ||
} | ||
out << formatTagLib.formatDate.call(attrs) | ||
} | ||
} |
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
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
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
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