Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Date format
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sarah Matthews  
View profile   Translate to Translated (View Original)
 More options Jul 24 2012, 8:55 pm
From: Sarah Matthews <sarah88.matth...@gmail.com>
Date: Tue, 24 Jul 2012 17:55:28 -0700 (PDT)
Local: Tues, Jul 24 2012 8:55 pm
Subject: Date format

Morning Guys

I changed the data format in Forms.js file *makeDateTime* function to *d/m/y
*, looks fine in the plan journey form, however it return me error when I
try to plan the journey because the *opentripplanner-api-webapp* still
using *m/d/y* format.

Any one know is any other files I need to change, please?

Many Thanks

S


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FrankP  
View profile   Translate to Translated (View Original)
 More options Jul 25 2012, 3:38 am
From: FrankP <fxpurc...@gmail.com>
Date: Wed, 25 Jul 2012 00:38:07 -0700 (PDT)
Local: Wed, Jul 25 2012 3:38 am
Subject: Re: Date format

Hey Sarah,

config.js is the place to make such changes.  BTW, the goal of config.js is
that it's the single place where customization changes like date format,
etc... are made (and I don't recommend mucking with Forms.js or other .js
files beyond config.js, unless you're adding new functionality).

Anyway, to change the date format, add the following to config.js at about
line 14:

otp.config.locale.time.date_format = "d/m/y";   (to be extra thorough, you
can also override your chosen locale's date_format, ala otp.locale.English.t
ime.date_format = "d/m/y").  

BTW, there are two other date / time related format fields to be overridden
(and changing those should change date / time formats across the web app):

otp.config.locale.time.format = "d/m/y @ H:i";

otp.config.locale.time.time_format = "H:i";

Take care,

Frank


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FrankP  
View profile   Translate to Translated (View Original)
 More options Jul 25 2012, 4:57 am
From: FrankP <fxpurc...@gmail.com>
Date: Wed, 25 Jul 2012 01:57:32 -0700 (PDT)
Local: Wed, Jul 25 2012 4:57 am
Subject: Re: Date format

BTW, I added an otp.locale.English_UK.js to the mix as an alternate to
what's in English.js (with the only difference right now being the date &
time formats).  If there are any other changes (both date formats, and/or
string localizations) you'd like to make to English_UK.js Sarah, send them
along or check them into a github fork.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wombatoo  
View profile  
 More options Jul 25 2012, 10:29 pm
From: Wombatoo <fay.q...@gmail.com>
Date: Wed, 25 Jul 2012 19:29:06 -0700 (PDT)
Local: Wed, Jul 25 2012 10:29 pm
Subject: Re: Date format

Thanks Frank :P

Tried just now, put the code into config.js file as below:

// step 1: make sure we have some type of otp.config, and otp.config.local
defined
if(typeof(otp) == "undefined" || otp == null) otp = {};
if(typeof(otp.config) == "undefined" || otp.config == null) otp.config = {};
if(typeof(otp.config.locale) == "undefined" || otp.config.locale == null)
otp.config.locale = otp.locale.English;

*otp.config.locale.time.date_format = "d/m/y";*
*otp.config.locale.time.format = "d/m/y @ H:i";*
*otp.config.locale.time.time_format = "H:i";*

// step 2: create an object of default otp.config default values (see step3
where we apply this to any existing config

However, the date format still not change on the form and param on the url
...

Any idea, please ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sarah Matthews  
View profile  
 More options Jul 25 2012, 10:34 pm
From: Sarah Matthews <sarah88.matth...@gmail.com>
Date: Wed, 25 Jul 2012 19:34:50 -0700 (PDT)
Local: Wed, Jul 25 2012 10:34 pm
Subject: Re: Date format

Me 2, tried yesterday but also not working for me.

Just think maybe we're using the old otp version. Which version ur using at
moment ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Purcell  
View profile  
 More options Jul 25 2012, 10:40 pm
From: Frank Purcell <fxpurc...@gmail.com>
Date: Wed, 25 Jul 2012 19:40:28 -0700
Local: Wed, Jul 25 2012 10:40 pm
Subject: Re: Date format

Weird.  I'm using the latest code from head, but can't imagine that change wouldn't work fom many versions back (but I did fix a time bug on the intone tart yesterday).  Other option is editing English.js directly (but that's not good long term as it bound to change on the future).  

On Jul 25, 2012, at 7:34 PM, Sarah Matthews <sarah88.matth...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sarah Matthews  
View profile  
 More options Jul 26 2012, 12:08 am
From: Sarah Matthews <sarah88.matth...@gmail.com>
Date: Wed, 25 Jul 2012 21:08:29 -0700 (PDT)
Local: Thurs, Jul 26 2012 12:08 am
Subject: Re: Date format

Yes....

I just check my English.js - and it looks really old version - no
"date_format" inside time section ....

So... if I add "date_format" into the time section like this:

time:
    {
        minute         : "minute",
        minutes        : "minutes",
        minute_abbrev  : "min",
        minutes_abbrev : "mins",
        second_abbrev  : "sec",
        seconds_abbrev : "secs",
        format         : "js F Y @ g:ia",
        date_format    : "j/n/Y",
        months         : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

Is any files I need to change, please?

xxxx


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Purcell  
View profile  
 More options Jul 26 2012, 3:50 am
From: Frank Purcell <fxpurc...@gmail.com>
Date: Thu, 26 Jul 2012 00:50:10 -0700
Local: Thurs, Jul 26 2012 3:50 am
Subject: Re: Date format

In this case, you would need to upgrade to the latest code.   Not having date format in your code means that things are probably hard wired all over the place...upgrade and you'll benefit from having a single place to change dates (and a few other benefits since).  

On Jul 25, 2012, at 9:08 PM, Sarah Matthews <sarah88.matth...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »