A small enhancement request

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

A small enhancement request

Chris Hermansen
Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Dustin Clark
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Chris Hermansen
Dustin, thanks for the reply.

I'm currently using 2.5.1

On Thu, Feb 11, 2016 at 1:54 PM, Dustin Clark <[hidden email]> wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6_tt%3DU4STmupkZYnEYABPfdRq87sSbFSSrD2O7uMf-hXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Chris Malan
In reply to this post by Dustin Clark
I've had a look at this plugin, downloaded the code and looked at that.  This is really a neat plugin.  I've installed in in all my 2.5 projects for next time I upload.  Hope you port it to 3 soon.

On Friday, February 12, 2016 at 8:54:58 AM UTC+11, Dustin Clark wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.

<a href="https://grails.org/plugin/timezone-detection" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgrails.org%2Fplugin%2Ftimezone-detection\46sa\75D\46sntz\0751\46usg\75AFQjCNGxocH6ydHQU9MZp8MbWi-fmXvNHA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgrails.org%2Fplugin%2Ftimezone-detection\46sa\75D\46sntz\0751\46usg\75AFQjCNGxocH6ydHQU9MZp8MbWi-fmXvNHA&#39;;return true;">https://grails.org/plugin/timezone-detection


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="1xJik4wXAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">clher...@...> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1xJik4wXAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-dev-discuss+unsubscribe@....
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1xJik4wXAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;">https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/2124259b-e54a-43ae-932e-6252daa103a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Dustin Clark
Thanks Chris.  I have several plugins that I intend to upgrade, and this is one of them.  Will let you know when that happens.

Dustin

Sent from my iPhone

On Feb 12, 2016, at 3:16 AM, Chris Malan <[hidden email]> wrote:

I've had a look at this plugin, downloaded the code and looked at that.  This is really a neat plugin.  I've installed in in all my 2.5 projects for next time I upload.  Hope you port it to 3 soon.

On Friday, February 12, 2016 at 8:54:58 AM UTC+11, Dustin Clark wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.

<a href="https://grails.org/plugin/timezone-detection" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgrails.org%2Fplugin%2Ftimezone-detection\46sa\75D\46sntz\0751\46usg\75AFQjCNGxocH6ydHQU9MZp8MbWi-fmXvNHA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgrails.org%2Fplugin%2Ftimezone-detection\46sa\75D\46sntz\0751\46usg\75AFQjCNGxocH6ydHQU9MZp8MbWi-fmXvNHA&#39;;return true;">https://grails.org/plugin/timezone-detection


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <<a href="javascript:" target="_blank" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">clher...@...> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-dev-discuss+unsubscribe@....
To post to this group, send email to <a href="javascript:" target="_blank" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-de...@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;">https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/2124259b-e54a-43ae-932e-6252daa103a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/4362144717373828196%40unknownmsgid.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Chris Hermansen
In reply to this post by Dustin Clark
Hi Dustin,

I read over the documentation and I'm not sure this does what I'm asking.

What I see is a disconnect between g:formatDate, for which the timezone CAN be specified via the timeZone parameter (and the setting verified when the "z" format code is included in the format string), and the g:datePicker, for which the timezone CANNOT be specified (nor verified).

According to my testing, the g:datePicker uses the server timezone, whereas the g:formatDate uses the client timezone unless changed by timeZone, which also seems weird to me... though for my current purposes, given that I can't configure g:datePicker to use the timezone of my choice, I'm grateful that it uses the server timezone.

On Thu, Feb 11, 2016 at 1:54 PM, Dustin Clark <[hidden email]> wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6_ZrCBL7bd78qzrk%2BSEMxdZnbhbwY6bMfXK94Zb36EZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Dustin Clark
You shouldn’t specify the timezone parameter on either tag, as it will be detected for you.  Maybe I’m not following what you’re asking for, but the plugin basically does the following:

  • Detects user’s current timezone using this JS library
  • When dates are rendered (either in a datepicker or the formatDate tag), server time is adjusted to the user’s local time
  • When dates are posted back to your server, dates are adjusted from the user’s time back to server time.

As a practical example, say that server time is noon UTC, and I’m in central time (UTC -6).  Using formatDate on the current time (new Date()) would render 6AM.  Additionally, setting the value on a date picker to new Date() would render the date picker defaulted to 6AM.  However, when the form is submitted, the date is adjusted back to server time, so in your controller, you’d see noon again.

Anyways, hope this helps.

Dustin


On Feb 12, 2016, at 12:39 PM, chris hermansen <[hidden email]> wrote:

Hi Dustin,

I read over the documentation and I'm not sure this does what I'm asking.

What I see is a disconnect between g:formatDate, for which the timezone CAN be specified via the timeZone parameter (and the setting verified when the "z" format code is included in the format string), and the g:datePicker, for which the timezone CANNOT be specified (nor verified).

According to my testing, the g:datePicker uses the server timezone, whereas the g:formatDate uses the client timezone unless changed by timeZone, which also seems weird to me... though for my current purposes, given that I can't configure g:datePicker to use the timezone of my choice, I'm grateful that it uses the server timezone.

On Thu, Feb 11, 2016 at 1:54 PM, Dustin Clark <[hidden email]> wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6_ZrCBL7bd78qzrk%2BSEMxdZnbhbwY6bMfXK94Zb36EZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/C218AFC6-697B-40DA-A40C-2BC13F5A70E2%40captivatelabs.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Chris Hermansen
Thanks, Dustin, but that's not what I want.

I have a server that must run in a specific time zone (because that's where the events are that are being recorded).

I want all users everywhere to be working in that time zone conciously, because that's where the events are taking place.  So if they want to enter an event that's taking place at 15:20 in that locale, I want them to enter 15:20 in the data entry screen and I want them to see 15:20 on the report and I want them to be aware of the actual time zone at all times.  In other words, the users' time zone is irrelevant.

Make sense?

On Fri, Feb 12, 2016 at 12:11 PM, Dustin D. Clark <[hidden email]> wrote:
You shouldn’t specify the timezone parameter on either tag, as it will be detected for you.  Maybe I’m not following what you’re asking for, but the plugin basically does the following:

  • Detects user’s current timezone using this JS library
  • When dates are rendered (either in a datepicker or the formatDate tag), server time is adjusted to the user’s local time
  • When dates are posted back to your server, dates are adjusted from the user’s time back to server time.

As a practical example, say that server time is noon UTC, and I’m in central time (UTC -6).  Using formatDate on the current time (new Date()) would render 6AM.  Additionally, setting the value on a date picker to new Date() would render the date picker defaulted to 6AM.  However, when the form is submitted, the date is adjusted back to server time, so in your controller, you’d see noon again.

Anyways, hope this helps.

Dustin


On Feb 12, 2016, at 12:39 PM, chris hermansen <[hidden email]> wrote:

Hi Dustin,

I read over the documentation and I'm not sure this does what I'm asking.

What I see is a disconnect between g:formatDate, for which the timezone CAN be specified via the timeZone parameter (and the setting verified when the "z" format code is included in the format string), and the g:datePicker, for which the timezone CANNOT be specified (nor verified).

According to my testing, the g:datePicker uses the server timezone, whereas the g:formatDate uses the client timezone unless changed by timeZone, which also seems weird to me... though for my current purposes, given that I can't configure g:datePicker to use the timezone of my choice, I'm grateful that it uses the server timezone.

On Thu, Feb 11, 2016 at 1:54 PM, Dustin Clark <[hidden email]> wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6_ZrCBL7bd78qzrk%2BSEMxdZnbhbwY6bMfXK94Zb36EZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/C218AFC6-697B-40DA-A40C-2BC13F5A70E2%40captivatelabs.com.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6-Jo47E1C1e9SN%2B5aE-0SHghiRzvS_GEErmf_88cgXEhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Dustin Clark
Yes, it does, and there’s a much easier solution for that:

TimeZone.setDefault(TimeZone.getTimeZone("UTC"))

in Bootstrap.groovy And 

-Duser.timezone=UTC

on JAVA_OPTS.


Dustin

On Feb 12, 2016, at 3:25 PM, chris hermansen <[hidden email]> wrote:

Thanks, Dustin, but that's not what I want.

I have a server that must run in a specific time zone (because that's where the events are that are being recorded).

I want all users everywhere to be working in that time zone conciously, because that's where the events are taking place.  So if they want to enter an event that's taking place at 15:20 in that locale, I want them to enter 15:20 in the data entry screen and I want them to see 15:20 on the report and I want them to be aware of the actual time zone at all times.  In other words, the users' time zone is irrelevant.

Make sense?

On Fri, Feb 12, 2016 at 12:11 PM, Dustin D. Clark <[hidden email]> wrote:
You shouldn’t specify the timezone parameter on either tag, as it will be detected for you.  Maybe I’m not following what you’re asking for, but the plugin basically does the following:

  • Detects user’s current timezone using this JS library
  • When dates are rendered (either in a datepicker or the formatDate tag), server time is adjusted to the user’s local time
  • When dates are posted back to your server, dates are adjusted from the user’s time back to server time.

As a practical example, say that server time is noon UTC, and I’m in central time (UTC -6).  Using formatDate on the current time (new Date()) would render 6AM.  Additionally, setting the value on a date picker to new Date() would render the date picker defaulted to 6AM.  However, when the form is submitted, the date is adjusted back to server time, so in your controller, you’d see noon again.

Anyways, hope this helps.

Dustin


On Feb 12, 2016, at 12:39 PM, chris hermansen <[hidden email]> wrote:

Hi Dustin,

I read over the documentation and I'm not sure this does what I'm asking.

What I see is a disconnect between g:formatDate, for which the timezone CAN be specified via the timeZone parameter (and the setting verified when the "z" format code is included in the format string), and the g:datePicker, for which the timezone CANNOT be specified (nor verified).

According to my testing, the g:datePicker uses the server timezone, whereas the g:formatDate uses the client timezone unless changed by timeZone, which also seems weird to me... though for my current purposes, given that I can't configure g:datePicker to use the timezone of my choice, I'm grateful that it uses the server timezone.

On Thu, Feb 11, 2016 at 1:54 PM, Dustin Clark <[hidden email]> wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6_ZrCBL7bd78qzrk%2BSEMxdZnbhbwY6bMfXK94Zb36EZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/C218AFC6-697B-40DA-A40C-2BC13F5A70E2%40captivatelabs.com.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6-Jo47E1C1e9SN%2B5aE-0SHghiRzvS_GEErmf_88cgXEhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/07651893-2663-4145-B0FE-E908B616440E%40captivatelabs.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A small enhancement request

Chris Hermansen
Hi again, Dustin.

I've actually set my server's time zone in grails-app/conf/spring/resources.groovy, rather than using BootStrap.groovy and JAVA_OPTS.

But that doesn't deal withmy request, which is making g:datePicker timezone explicit and matching g:formatDate, if you see what I mean; g:datePicker needs a "timeZone" parameter. And it wouldn't hurt for the reference documentation to be explicit about the behaviours of both.  From what I can determine, g:datePicker lives on server time.  Not completely sure about g:formatDate.

On Fri, Feb 12, 2016 at 1:33 PM, Dustin D. Clark <[hidden email]> wrote:
Yes, it does, and there’s a much easier solution for that:

TimeZone.setDefault(TimeZone.getTimeZone("UTC"))

in Bootstrap.groovy And 

-Duser.timezone=UTC

on JAVA_OPTS.


Dustin

On Feb 12, 2016, at 3:25 PM, chris hermansen <[hidden email]> wrote:

Thanks, Dustin, but that's not what I want.

I have a server that must run in a specific time zone (because that's where the events are that are being recorded).

I want all users everywhere to be working in that time zone conciously, because that's where the events are taking place.  So if they want to enter an event that's taking place at 15:20 in that locale, I want them to enter 15:20 in the data entry screen and I want them to see 15:20 on the report and I want them to be aware of the actual time zone at all times.  In other words, the users' time zone is irrelevant.

Make sense?

On Fri, Feb 12, 2016 at 12:11 PM, Dustin D. Clark <[hidden email]> wrote:
You shouldn’t specify the timezone parameter on either tag, as it will be detected for you.  Maybe I’m not following what you’re asking for, but the plugin basically does the following:

  • Detects user’s current timezone using this JS library
  • When dates are rendered (either in a datepicker or the formatDate tag), server time is adjusted to the user’s local time
  • When dates are posted back to your server, dates are adjusted from the user’s time back to server time.

As a practical example, say that server time is noon UTC, and I’m in central time (UTC -6).  Using formatDate on the current time (new Date()) would render 6AM.  Additionally, setting the value on a date picker to new Date() would render the date picker defaulted to 6AM.  However, when the form is submitted, the date is adjusted back to server time, so in your controller, you’d see noon again.

Anyways, hope this helps.

Dustin


On Feb 12, 2016, at 12:39 PM, chris hermansen <[hidden email]> wrote:

Hi Dustin,

I read over the documentation and I'm not sure this does what I'm asking.

What I see is a disconnect between g:formatDate, for which the timezone CAN be specified via the timeZone parameter (and the setting verified when the "z" format code is included in the format string), and the g:datePicker, for which the timezone CANNOT be specified (nor verified).

According to my testing, the g:datePicker uses the server timezone, whereas the g:formatDate uses the client timezone unless changed by timeZone, which also seems weird to me... though for my current purposes, given that I can't configure g:datePicker to use the timezone of my choice, I'm grateful that it uses the server timezone.

On Thu, Feb 11, 2016 at 1:54 PM, Dustin Clark <[hidden email]> wrote:
Which version of Grails are you on?  I have a plugin that does almost exactly that, but I have not updated to Grails 3.x yet.


Dustin

Sent from my iPhone

On Feb 11, 2016, at 3:38 PM, Chris Hermansen <[hidden email]> wrote:

Good people;

I don't know if this is the correct place, or the correct way; please feel free to chastise me if not!

I propose adding a "timeZone" parameter to g:datePicker to permit the entry of date/time in user-local coordinates and conversion to server-local coordinates, and alternatively to force interpretation of time entered as in a specific timeZone (normally that of the server).

I propose showing the value selected as part of the datePicker fields.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/48882633-ccc3-4ffb-8893-781198bdcba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/-6539863705293359878%40unknownmsgid.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6_ZrCBL7bd78qzrk%2BSEMxdZnbhbwY6bMfXK94Zb36EZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/C218AFC6-697B-40DA-A40C-2BC13F5A70E2%40captivatelabs.com.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6-Jo47E1C1e9SN%2B5aE-0SHghiRzvS_GEErmf_88cgXEhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/l3VXl09CkDQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/07651893-2663-4145-B0FE-E908B616440E%40captivatelabs.com.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CACc2_6-5jJ7KKkdKWUo2KrEdA%3DxARqO4mqOdKdN61Ji9W5nv5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.