Jump to:

3431 Posts in 1025 Topics by 864 members

Template Questions

SilverStripe Forums » Template Questions » <% if date = .... ?????

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 1407 Views
  • benni91
    Avatar
    Community Member
    72 Posts

    Re: <% if date = .... ????? Link to this post

    i added $Date.NiceUS to my referencepage.ss tempalte. but it didn't solve the problem
    my output is still the whole references

    can you help me via Teamviewer or skype remote display function?

  • zenmonkey
    Avatar
    Community Member
    527 Posts

    Re: <% if date = .... ????? Link to this post

    I think our edits are getting crossed

    Like I said the User setting has no effect on the way the value is Saved only in certain outputs. so just force it in the template

    Here is the date refrence http://api.silverstripe.org/2.4/sapphire/model/Date.html

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: <% if date = .... ????? Link to this post

    I think you're right

    in my template if got the date output $Date.NiceUS => e.g. 01.01.2010
    but it didn't work

    what should i do?

    damn ss is getting me crazy

  • zenmonkey
    Avatar
    Community Member
    527 Posts

    Re: <% if date = .... ????? Link to this post

    Unfortunately I don;t have skype set up on this my office computer, feel free to email the PHP and SS files in question to rick at designplusawesome dot com and I'll poke around

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: <% if date = .... ????? Link to this post

    THX!
    E-Mail will be there in a few minutes. i'll send you an test acc for the site too, so you can see the problem ;)

  • zenmonkey
    Avatar
    Community Member
    527 Posts

    Re: <% if date = .... ????? Link to this post

    NiceUS outputs 07/27/2011 for me. You could also try $Date.Nice

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: <% if date = .... ????? Link to this post

    Tried it doesn't work :/

    got my mail?

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: <% if date = .... ????? Link to this post

    You should just be able to use $Date.Format(d.m.y) to get dd.mm.yy. $Date.Format() accepts everything that the date function accepts as a format.

    1407 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.