Modifying Current Date Action

I have a client who wants to have his copyright mark on the footer of his website updated as the years go by. Right now I just have it set to year manually and would need an action that would update the year every-time it changes. I see Tim Plumb wrote an action, but I don’t need the whole date (month or day) just the year.

Is there an easy way to do that?

Thanks in advance.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you want to do this in JavaScript, then the syntax would be this:

var d = new Date();
document.write(d.getYear());

Take a look through the Action for where a new Date() object is
created, then adapt the code above to change the formatting.

Walter

On Apr 3, 2008, at 10:10 PM, Mitchell wrote:

I have a client who wants to have his copyright mark on the footer
of his website updated as the years go by. Right now I just have
it set to year manually and would need an action that would update
the year every-time it changes. I see Tim Plumb wrote an action,
but I don’t need the whole date (month or day) just the year.

Is there an easy way to do that?

Thanks in advance.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry, wrote too quickly. getYear has been deprecated in favor of
getFullYear().

Walter

On Apr 3, 2008, at 10:10 PM, Mitchell wrote:

I have a client who wants to have his copyright mark on the footer
of his website updated as the years go by. Right now I just have
it set to year manually and would need an action that would update
the year every-time it changes. I see Tim Plumb wrote an action,
but I don’t need the whole date (month or day) just the year.

Is there an easy way to do that?

Thanks in advance.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Seems a bit beyond my skill level, I tried about twice now, can’t seem to draw much working. Thought it’d be simpler. Can i just add the javascript into a markup item and put it in there?

Thanks waltd for your help.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ve had a look in the Action code, and I can see why you would feel
that way! It’s set up to make two different formats of date, but not
in an open-ended way that would allow you to swap your own format in
there.

So try this. Inside the run of text where you want to put the year,
with a text cursor flashing at the point where the year should go,
select Insert > Markup Item from the main menu.

In the Markup Item, add the following code:

<script type="text/javascript">
	var d = new Date();
	document.write(d.getFullYear());
</script>

You can put all that on one line if you like, or you can leave it
formatted like this so it’s easier to read. It won’t make any
difference either way.

Okay the dialog, and publish or preview. You should see the year in
any browser view. The design view will just show the little markup item.

Walter

On Apr 4, 2008, at 3:26 AM, Mitchell wrote:

Seems a bit beyond my skill level, I tried about twice now, can’t
seem to draw much working. Thought it’d be simpler. Can i just
add the javascript into a markup item and put it in there?

Thanks waltd for your help.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

When i was editing the action it kept giving me an error with the date section and then things got real messy…but this looks a lot easier. Thanks.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options