search for: date_formats

Displaying 20 results from an estimated 68 matches for "date_formats".

2007 Nov 02
0
DATE_FORMATS and functional tests
I have the following in my environments.rb file: my_formats = { :msc => ''%d %b %Y %I:%M %p'', :msc_short => ''%d %b %Y'' } ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge! (my_formats) ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge! (my_formats) With this, things like ''invite.created_at.to_s(:msc_short)'' work perfectly in all my views during normal operation. However, any functional test that includes a view template w...
2006 Mar 14
21
Changing default date format in Rails
I''ve spent all day digging through the rails api and postgres-pr on this, I think it''s time to ask the list. Postgres stores a Date in YYYY-MM-DD format. My users want the dates in MM/DD/YYYY format. Sure, I could explicitly convert it on the app level every place where a date is displayed, but that seemed like a DRY violation. I thought I''d be clever and simply
2008 Jun 07
3
DRY validates_format_of?
In a model I have following validates_format_of. Is there an easy way to DRY this up? It seems to be rather repetitive. validates_format_of :expiration_date, :with => /^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/ validates_format_of :activation_date, :with => /^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/ validates_format_of :some_other_date, :with =>
2006 Jul 17
2
european date format
...nter the date in iso format, so i have to make my applications in such a way that not only dates are displayed in the "dd-mm-yyy" format but also can be entered in that way. somewhere i found this code to put in the environment script: ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update( :default => ''%d/%m/%Y @ %H:%M: %p'' ) ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update( :default => ''%d/%m/%Y'' ) this works great for displaying dates, the only problem is i can''t input a new date anymore: i tried:...
2006 Mar 23
5
Custom date format
...DefineYourOwnDateFormat.html It seems pretty straightforward but obviously it doesn''t work for me... article.date_edited.to_formatted_s(:my_format_1) produce a default formatted date, not the one I''ve defined in environment.rb : ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!( :my_format_1 => ''%d/%m/%Y - %H:%M'', :my_format_2 => ''%l:%M %p, %B %d, %Y'' ) What''s wrong ? Thanks -- Posted via http://www.ruby-forum.com/.
2009 Jun 15
1
calendardateselect problem
I am using http://code.google.com/p/calendardateselect/ for my date time picker. I am using dd.mm.yyyy format (:finnish) and i am using ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge! (:default => "%d.%m.%Y") ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge! (:default => "%d.%m.%Y %H:%M") in my enviroment. Everything is working fine on my machine. However when I deploy on heroku day and month switch places so : 12.01.2009 bec...
2003 Jul 11
4
module : cdr_sybase.so
If anyone is interested ... just in case! :-)... I have tried to write , based on the cdr_mysql.so module, an Sybase module. To compile you can use something like that: export SYBPLATFORM=linux export SYBASE=/opt/sybase cc -I$SYBASE/include -c -o cdr_sybase.o cdr_sybase.c cc -shared -Xlinker -x -o cdr_sybase.so cdr_sybase.o -lsybdb -lm -L$SYBASE/lib (anyone could write the corect Makefile
2005 Sep 06
1
US Date Handling in Rails
My application is built on Rails and MySQL. It will only be accepting US formatted dates as input, however both Rails and MySQL are oriented around ISO the format. I know I can convert a good portion of the entries using ParseDate::parsedate but it does not appear this is how the conversion is taking place when data is being transferred from the params hash into model members. Say I have a field
2006 Jun 14
5
display formatted date
Hi, In my form I have date field set as ''datetime_select'' which is fine as I wanted it in the same format. But while displaying (list action) it displays date in long format i.e. ''Tue May 30 15:39:00 Central Daylight Time 2006''. How can I format it so that it will just be diaplyed as ''dd/mm/yyyy'' format? Thanks -- Posted via
2006 Jul 27
9
CalendarHelper
Has anyone had any luck using the CalendarHelper plugin at http://wiki.rubyonrails.com/rails/pages/CalendarHelper recently? I''m scratching my head over the following error when I look at any page in my application: NameError in CalendarController#index undefined local variable or method `date_format'' for #<CalendarController:0x24ccd4c> RAILS_ROOT:
2006 Feb 23
2
find_by_sql aliasing issue when accessing attributes
I was recently having problems accessing attributes in an object. Can somebody explain to me why this is, and if it is a bug? I have the following code: @archives = RapturePost.find_by_sql "select distinct date_format(rapture_posts.date_created,''%Y-%m'') date_created from rapture_posts where rapture_posts.site_id = 1 order by rapture_posts.date_created desc" I
2006 Aug 17
3
Use collection_select
I use the following code in my view: <%= collection_select(''datedata'', ''date'', @allDate, :id, :date) %> It''s show me the date of all entries in the database (Dropdown menu). Additional, I wrote a helper method "showDate" in the application_helper.rb! How can I use this method in the collection_select for every date entry? thanks
2006 Jan 07
1
How to DRY with Fixtures (helper or extend Time class, how)?
I have a test/fixtures/users.yml like so: apa: id: 1 username: apa [...] created_at: <%=Time.now.strftime("%Y-%m-%d %H:%M:%S")%> updated_at: <%=Time.now.strftime("%Y-%m-%d %H:%M:%S")%> I don''t like how I''m repeating myself with the strftime bit. Is there some shorter Time method to format time for a (MySQL) datetime field that
2018 May 09
0
Seasonal weekly average
Hi Shakeel, Assuming that you are starting with a bunch of dates: # make a vector of character strings that can be converted to dates rep_dates<-paste(sample(1:30,500,TRUE),sample(1:12,500,TRUE), sample(2013:2017,500,TRUE),sep="/") # if this isn't your format, change it date_format<-"%d/%m/%Y" # create a data frame with a column of dates
2010 Aug 13
4
Rails and Oracle - can select date but cannot save
I''m seeing a behavior in Rails that I find very strange. Having worked quite a bit with Oracle with other languages I would always dutifully do ALTER SESSION SET NLS_DATE_FORMAT = <my_date_format> and ensure I use that date format in my application. With Rails I still have not figured out how to execute an ALTER SESSION statement after connecting to the database (I''m using
2006 Feb 10
14
dynarch calendar and calendar helper usage
I am playing around with this and reference this wiki from RonR site... http://wiki.rubyonrails.org/rails/pages/CalendarHelper The error I am getting is: NameError in Placements#list undefined local variable or method `date_format'' for #<PlacementsController:0xb78f9ef4> RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace
2009 Jul 28
3
CIsco 7960 + asterisk: hepl needed
Dear All, I'm trying to configure my new phone Cisco 7960 to work with asterisk. I followed http://www.asteriskguru.com/tutorials/cisco_7960_ip_phone_configuration.html and I got into the point where I can see on the the display line indication showing "55 <phone icon with x>" so it looks like the phone is not registered. The phone and the asterisk are in the same local
2018 May 09
3
Seasonal weekly average
Hi, I am fairly new to 'R' and would like advice on the following. I want to calculate a weekly average number of reports (e.g. of flu, norovirus) based on the same weeks for the last five years. I will then use this to plot a chart with 52 points for the average based on the last five years; another line will then plot the current year, enabling a comparison of current weekly counts
2006 Jul 27
1
getdate_column
Plugin location: http://svn.kylemaxwell.com/getdate_column/ ** Won''t work on Windows ** OVERVIEW =================== Getdate_column is designed to make the accessor methods of a datetime column accept and return string representations of the date (e.g. "today", "10 days from now", "1/2/06 10pm"). I personally find date controls on the web to be clumsy,
2007 Nov 19
2
login help - grouping records
I have a long list of posts posted on different days and many posts every day. I want them to arrange like following... Date1 ----- post1 post2 Date2 ----- post3 post4 post5 How can I (say) group them to appear all posts of one date under their related headng. Because records have so many different days, it is confusing me.. I need some generic solution. Thanks in advance. -- Posted via