Displaying 8 results from an estimated 8 matches for "format_d".
Did you mean:
formated
2006 Apr 20
5
Noobie problems with helper
I have the following helper method in application_helper.rb:
def format_date(date)
day = to_s(date.day)
month = to_s(date.month)
time = to_s(date.time)
date = day + "/" + month + " - " + time
return date
end
I am trying to call this method in a view like this:
<%= format_date(bounty.created_on) %>
create_on is a timesta...
2006 Jan 09
5
Formatting timestamp objects
I want to print my timestamp objects in a specific format. I want to print
a date like this:
Sunday, January 8 2006
I don''t want it to print January 08.
For the time, I want it to look like this:
9:08 pm
Not 09:08 and lower case PM. I created these methods:
def format_date(date)
date.strftime("%A, %B #{date.day} #{date.year}")
end
def format_time(date)
if date.hour > 12
hour = date.hour - 12
elsif date.hour == 0
hour = 12
else
hour = date.hour
end
time = "#{hour}:#{date.min} "
if date.hour &...
2005 Jul 18
0
why $cdr{'CALLERID'} and $cdr{'DNID'} are empty in perl agi connected with asterisk manager
...,
{ Name => 'Acct-Status-Type', Value => 'Stop'
},
{ Name => 'h323-call-type', Value =>
$cdr{'CALL_TYPE'} },
{ Name => 'h323-call-origin', Value =>
$cdr{'CALL_ORIGIN'} },
{ Name => 'h323-setup-time', Value =>
format_date($cdr{'CALL_START'}) },
{ Name => 'h323-connect-time', Value =>
format_date($cdr{'LINK_START'}) },
{ Name => 'h323-disconnect-time', Value =>
format_date($cdr{'LINK_END'}) },
{ Name => 'h323-disconnect-cause',...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...ld include it.
>
We were discussing this on IRC chat the other night, but I believe many
people underestimate the need for string formatting. Here are some data
points:
1. There are currently 1,637 calls to llvm::format() across the codebase,
and this doesn't include calls to format_hex(), format_decimal(), and the
other variants.
2. LLVM consists of a large number (20+ at a minimum) of focused tools
(llc, lli, llvm-dwarfdump, llvm-objdump, etc) whose sole purpose is to
output formatted text. Consider the use case of printing a verbose
disassembly listing which is fed into FileCheck.
3. Even...
2007 Feb 12
0
[864] trunk/wxruby2/samples/calendar/calendar.rb: Fix a couple of errors, add a note on CalendarDateAttr
...;lines">@@ -54,8 +54,7 @@
</span><span class="cx">
</span><span class="cx"> def on_calendar(event)
</span><span class="cx"> @date = event.get_date
</span><del>- log_message("Double-clicked #{format_date(@date)}")
- @parent.set_date(@date)
</del><ins>+ @display.set_date(@date)
</ins><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def on_calendar_change(event)
</span&...
2006 Nov 28
0
tzinfo_timezone/tzinfo can't modify frozen object
...description,90,''...''),
ticket_url(ticket), {:title => sanitize(ticket.description)}%>
27: <div class="subtext" style="margin-top:3px;
margin-bottom:14px;">
28: #<%= ticket.id%>
29: | Submitted
<%=format_date(@this_user.tz.utc_to_local(ticket.created_at))%> by <%=
name_or_me(ticket.submitter_id, Proc.new {ticket.submitter.name})%>
30: | <%=ticket.status%> <%if
ticket.ticket_type_id?%><%=ticket.ticket_type.downcase%><%end%>
31: <%if...
2006 May 16
4
question about strftime when called from partial.
Hi,
I''m calling a helper I''ve written - format_time() that is called from my
views with a given time that was selected from my database and was returned
to the view via an instance variable. When I call format_time from a
partial, I see that I get some kind of String error and the partial won''t
render. Basically, the object being passed in to format_time is already a
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