[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date input field enhancement by tavugyvitel.hu - worth to use it






On Sat, Aug 10, 2013 at 2:54 PM, John Locke <..hidden..> wrote:
Hi,

In 1.4 trunk, there is a Dojo date widget currently hooked up to the Journal Entry screen. I've been planning to move this into UI/lib/elements.html, basically create a "date" element that can then be more easily hooked up, and then there's a single place where the date format preferences can be handled for everywhere in the application... and a nifty drop-down date widget included. 

The autocomplete dropdowns were added to elements.html for the reason that they have a different HTML structure.  I am wondering how hard it would be to just getElementsByClass() and attach the scripts to these so that they could be more easily themed? 

What I haven't yet figured out is how to get the user's date format and locale preference injected into the template system. If somebody can more easily inject that into the environment so it can be accessed by a variable, this will be a very easy thing to solve.

maybe we should have a namespace USER (I am trying to keep reserved words all upper case) which would store this info?  Easy enough to add. 

The next question then becomes, do we localize in the JS only, or also on the server?

Here are some examples for how you can set date formats in the date widget: http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_DateTextBox.html , and then Dojo could automatically convert those to a single format that is actually submitted on the form -- this to me seems like the easier approach. Then the form post handler can expect a consistent format from anywhere.

For now I don't think it is likely to be feasible to stop doing localization on the server.  We do autodetect yyyy-mm-dd dates so any localization should use that format.    However as we move all code over, I can see the benefits of moving this onto the client for data entry.  I think for display we will still need it on the server though so I am not sure it is possible to do all of this. 

There are more date parsing formats available, we could even support custom formats as described here: http://dojotoolkit.org/reference-guide/1.9/dojo/date/locale/parse.html#dojo-date-locale-parse

Cool.

Best Wishes,
Chris Travers
 
Cheers,
John Locke
http://www.freelock.com


On 08/09/2013 05:36 AM, Erik Huelsmann wrote:


>>  
>> > Much of the new code has date fields being of class "date" which is there in part to allow _javascript_ handles to be added programmatically in a central manner.
>>  
>> >My larger question is this:  what is the best way to allow for customized handles like this?
>
> Hmmm, I have no idea. 
>
> If you mentioned, it is possible to hook custom _javascript_s for each class of input fields, probably a dedicated subdirectory could contain custom scripts. I guess it needs to develop a general framework.
>
> I guess you know more about the code and possibilities. :)

In my opinion, it'd be very good to include this in the discussion on UI improvements John, Brian, Mikkel and others are (going to be) having.

Possibly, this is just a matter of flipping a bit there (i hope :-)

Bye,

Erik.

!DSPAM:5204e505296858941011170!

------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
!DSPAM:5204e505296858941011170!


_______________________________________________ Ledger-smb-devel mailing list ..hidden.. https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
!DSPAM:5204e505296858941011170!


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel




--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.
http://www.efficito.com/learn_more.shtml