#369 ✓resolved
Carl Lerche

[APPLIED] Allow Time, Date, and DateTime properties to typecast from Hash

Reported by Carl Lerche | June 11th, 2008 @ 03:28 PM

Currently, when Time, Date, and DateTime are typecast, they are parsed from strings.

The patch I have attached allows these types to be cast from Hashes. This will help make the process from HTML forms to objects cleaner.

The hash keys are the same as the Time method names (year, month, day, hour, min, sec) and can be submitted as symbols or strings. Any missing keys are taken from Time.now.

PS. I made two commits, so git generated two patches. I zipped them up and attached the zip. I don't know if this is proper patch submitting etiquette.

Comments and changes to this ticket

  • Alex Coles

    Alex Coles June 11th, 2008 @ 05:31 PM

    • Title changed from “Allow Time, Date, and DateTime properties to typecast from Hash” to “[APPLIED] Allow Time, Date, and DateTime properties to typecast from Hash”

    I think this is useful functionality, and will definitely make it easier when hooking up with a UI.

    I applied this patch (it applies cleanly by the way -- no problem with zipping). All specs are passing.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) June 12th, 2008 @ 05:13 AM

    • State changed from “new” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Attachments

Pages