# Days in Calendar Week

**URL:** <https://forum.kirupa.com/t/days-in-calendar-week/351972>\
**Category:** flash\
**Created:** [November 2, 2014, 9:11pm UTC](https://forum.kirupa.com/t/days-in-calendar-week/351972 "2014-11-02T21:11:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SethXML](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@SethXML](https://forum.kirupa.com/u/SethXML)\
**Post date:** [November 2, 2014, 9:11pm UTC](https://forum.kirupa.com/t/days-in-calendar-week/351972/1 "2014-11-02T21:11:11Z")

</div>

Hello there!

I’m new at this forum, and I fight with a big problem, so all I want is to give out all Dates in a Calendar Week for excample next week we have week 45 and I have 5 Textfields, and in the first field there should be 3. Nov 2014 in the second 4. Nov in the third 5. Nov and so on til friday.

I found nothing in the web about this and it’s really complicated, so I hope somebody has already done something like that and can help me!

Thanks and King regards

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [November 3, 2014, 1:20am UTC](https://forum.kirupa.com/t/days-in-calendar-week/351972/2 "2014-11-03T01:20:13Z")

</div>

Here’s a way:

```javascript
var
	ts:Vector.<TextField> = new <TextField>[t1, t2, t3, t4, t5],
	week:uint = 45
	
ts.forEach(function(t:*, i:int, v:Vector.<TextField>):void {
	t.text = new Date(new Date().fullYear, 0, 2 + i + (week - 1) * 7 - (new Date(new Date().fullYear, 0, 1)).getDay()).toLocaleDateString()
})

```

It assumes the instance names of your TextFields are t1, t2, etc.

---

<div class="post-metadata">

**Author:** ![SethXML](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@SethXML](https://forum.kirupa.com/u/SethXML)\
**Post date:** [November 3, 2014, 7:07pm UTC](https://forum.kirupa.com/t/days-in-calendar-week/351972/3 "2014-11-03T19:07:30Z")

</div>

Hi!

I can’t thank you enough this is so fu\*kin’ easy but it’s exactly what I was looking for 5 weeks. Excuse my bad english, thanks a lot!!!

King regards
