Is it possible to convert quickly a strftime(“%u”) value to a strftime(“%A”) or do i need to build an equivalence hash like {“Monday” => 1, ……… “Sunday” => 6}
I have an Array with some day as decimal values
class_index=[2,6,7]
and I would like to loop through this array to build and array of days name like this
[nil, "Tuesday", nil, nil, nil, "Saturday", "Sunday"]
so I could do
class_list=[]
class_index.each do |x|
class_list[x-1] = convert x value to day name
end
Is that even possible?
How about:
Oh, I now see you’ve expanded your question. How about:
Let me explain that one:
The beauty of Ruby.