Use date as regular string field

Is there any way to get the dates field to not format as a date, and just save/return a string? What I want to do is change 'date' to 'dates' and then put a range in (like '2001-2007').

Thanks.

Comments

  • I probably do not understand your request since both the getImageDate and the getAlbumDate functions do not format the data unless you specifically request that they do.

    So, what date is it that you want? Where is it that you want to make this change?
  • fretzl Administrator, Developer
    Please correct me if I'm wrong.

    I think you want to display something like `2001-2007` with your albums or images ???

    If so, you could make use of the `codeblocks`. (they are available for every album and image)
    You can put in anything you like.

    Then replace `printAlbumDate()` or `printImageDate()` with
    `printCodeBlock([codeblock number])` in your theme files.
  • sbillard - when I enter a date on an album page like a range (ex 2001-2007) it will convert it into a formatted date (like 1.1.2010) or something like that. I'd like it to just be a text field that I can enter anything into.

    fretzl - you are correct, and your solution is probably the simplest, but since I'm doing this for a client the user interface needs to be simple enough for them to use in an intuitive way (I don't think the code blocks are the best thing in that scenario).

    Is this a far more complicated thing than I think it is (IE, involving editing core files etc.)?
  • Are you talking about the date on the album edit admin page? This must remain a proper date.

    My suggestion would be to use the custom data field for this. Your user can put the date range there. You use printImageCustomData()/printAlbumCustomData() rather than printImageDate()/printAlbumData() in the theme.

    You can even make the back-end more "user friendly" by customizing this field. For an example see the example plugin http://www.zenphoto.org/2009/11/filter-custom_data/

    For instance you could present two fields for him to fill in, the "from date" and the "to date".
Sign In or Register to comment.