[Question]
  [
Let's build an advent Calendar for this Christmas!
Many Advent calendars for children take the form of a large rectangular card with numbered windows for each day of December starting from 1 ( although advent time begins on Advent Sunday, which is the fourth Sunday before Christmas day and often happens to be on November) and leading up to and including Christmas Eve (24) or in some cases Christmas day (25).  
Windows are distributed across the calendar at a random position.  
Every day children open the corresponding calendar window to reveal a small gift(usually a chocolate)
# Task
The task is to display an advent calendar up to date following these rules:  
* Include Christmas day : 1 to 25
* For days that have passed put an opened empty window `[ ]` ( no different characters allowed ), so if i run the same code the next day there must be a new window opened.
* At the current day put an opened window with a gift in it `[@]` ( instead of `@` you can use every printable character excep for `space`, `[` , `]` and `digits` ).
* For the remaining days put only the day number.
* At Christmas all the windows will be open, the next day they are all closed ( a new calendar ).
* Windows must open only on December, windows must stay closed on every month except for December.
* It should work the same way the next year, and every year, that is for example on December 2099 Windows start opening.
* Windows are laid down in random order on a 5 rows x 5 columns grid.
* The grid has not to be accurate, just consider that every windows must have at least one character space separating them on every side: left, top, right and bottom hence numbers must have left and right spaces of at least two characters.
# Example
Today (15 December) :
```
  23   21   [ ]   18   [ ]   
  [ ]   [ ]   [ ]   [ ]   16   
  24   22   [ ]   17   [ ]   
  [ ]   [ ]   [ ]   25   19   
  [ ]   [ ]   [@]   [ ]   20
```
Tomorrow (16 December) :
```
  [ ]   17   25   [ ]   [ ]   
  [ ]   19   [ ]   18   21   
  [ ]   23   24   [ ]   [ ]   
  22   [@]   [ ]   [ ]   [ ]   
  [ ]   20   [ ]   [ ]   [ ]
```
On every month different than December
```
18 23 21 12 19
25 24 3 15 14
16 9 17 20 4
8 2 11 5 7
6 13 10 22 1
```
[Live example](https://tio.run/##hVFNa4MwGL7nVzx4KHEymYPCwAV22LW/wPYgNc4Ul0hMO8bob3dvEpmrO8xLPp73@Yqn@lKPR6sGd395mibWSwdnmvoTgICWH3itneRpGRC6HxGQ6lAy1hoLDg8ouipQ0vos8LilXZYppF8MqqWRooAQUTd/k25ntOt4is2GIX7Ew4JHSwR@8MyH89hxJBUOCSgLrgyyH2VUVzfiM/kv92XFXQ2oGbyuez3EXre1PHg8Wyu1oxEvU9EQPUqkNbGWwK52Xd72xlge97bWjXmngHde0Fv@kANhPjVBazl4aPYr/4mokAlsQ8pFWiDZ670GEmS/45JU@KnROD8Zpemt4OcoGxusooLcY2k5Td8 "JavaScript (V8) – Try It Online")
All [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply.
  
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 57 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Full program.
```
5 5⍴('[ ]'¨@{⍵∊⍳d}'[@]'¨@{⍵=d})⍣(</11 25≥m d←2↑1↓⎕TS)?⍨25
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qKO94L@pgumj3i0a6tEKseqHVjhUP@rd@qij61Hv5pRa9WgHuJhtSq3mo97FGjb6hoYKRqaPOpfmKqQ8aptg9KhtouGjtsmP@qaGBGvaP@pdYWQKMvi/AhgUAAA "APL (Dyalog Extended) – Try It Online")
`?⍨25` random selection without replacement of 25 out of 1…25
`⍣(`…`)` if:
 `⎕TS` date in `[Y,M,D,h,m,s,t]` format
 `1↓` drop one element; `[M,D,h,m,s,t]`
 `2↑` take two elements; `[M,D]`
 `m d←` distribute to variables `m=M` and `d=D` (for **m**onth-of-year and **d**ay-of-month numbers)
 `11 25≥` are `[11,25]` greater than or equal to these (gives `[0,1]` during advent, `[1,0]` or `[1,1]` before, and `[0,0]` after)
 `</` if the first number is less than the second…
 `(`…`)` then apply the following function:
  `@{`…`}` at elements where the following condition is true:
  `⍵=d` the elements are equal to `d` (today's day-of-month number)
  `'[@]'¨` replace each with the constant `"[@]"`
  `@{`…`}` at elements where the following condition is true:
  `⍵∊⍳d` the elements are members of 1…`d` (today's day-of-month number)
  `'[ ]'¨` replace each with the constant `"[ ]"`
`5 5⍴` reshape into a five-by-five matrix
[Answer]
# Python 2, ~~181~~ ~~189~~ ~~181~~ 179 Bytes
### Original Code
Since I can't comment on other answers yet, this is a slight improvement on ElPedro's previous answer. [Try it online!](https://tio.run/##FY1BDoMgFET3noK4AaIh0cQutDS9ByFqgFYa@Rj6k8bTU1zNzFu8OU7cIvQ5eznPPhwx4TxXKD2r7YoOfXA1F1cVGO16Mj6BxALOykjFqKINo4S29Em5slKCbqim7WIXrlCECLjduz4mYh@gX1cSD6TY0wo2huL@ruHYHSv77VjX9jfe9gPX1W/zuyNmPJIHLBfiEz0wo8ZB88lIo4ZR5/wH) I changed ElPedro's 5th line to save an additional 9 bytes.
```
i=__import__
t=i("datetime").date.today();n=t.day
c=[('['+(' ','@')[d==n]+']',`d`)[t.month<12or d>n]for d in i("random").sample(range(1,26),25)]
while c:print' '.join(c[:5]);c=c[5:]
```
### Correction #1
Gained 6 bytes in order to fix an error where windows remain open after December 25th until the new year. [Try it online!](https://tio.run/##VY5Ba8QgEIXv@RWyPagkSCNkD9m6FNqf0JtI1upsY4kazMCyvz41x17mzWOG9731iXNOct@DmqYQ11xwmhpUgZ28RcAQ4cTFsQrM3j4ZvzQvX7AhcdkDuedCPsFB/IZC7B3rlAPOgnwc10cJiJBITqQ/H3@iJmP7P/sQDwtaVuM31b/yJimsyGfjlGZU05ZRQjv6Trn2SiXTUkO7m79xjSLmhPNbL2uPdJVDFX9N5qjlSUikoopNPscK2mxcF2DV/wDrO3nmnRy4aR5zWIC4cS0hYSWJ3xwSc3ocDL845fQwmn3/Aw)  
See corrected version of line 3 below:
```
c=[('['+(' ','@')[d==n]+']',`d`)[t.month<12or n>25or d>n]for d in i("random").sample(range(1,26),25)]
```
### Correction #2
As per AZTECCO's suggestions, I'm back at 181 bytes :) [Try it online!](https://tio.run/##FYxLCsMgFAD3OYV0o5IPjZAukgq9h4gJahtLfIb0QQnk7jbdzcxi1h3nBCLnII0JcU0bGlOgDOziJvQYor/w5o8NJjftjA8g8Qx7YaViVNGSkgdVTkrQJdW0Gt3IFTYxAc51Kw7R1XBA7e5X/UwbcSQAOe/bBC7F8/2Z4rp4dvrLs7YSN16JjuviO4fFE9uvWwCkhDbvFIBZ1XeaD1Za1fU65x8)
```
c=[('['+' @'[d==n]+']',`d`)[t.month-12|25-n|n-d<0]for d in i("random").sample(range(1,26),25)]
```
### Final
With streamlined `import` statements (Thanks to Reinstate Monica)
```
import random,datetime as D
t=D.date.today();n=t.day
c=[('['+' @'[d==n]+']',`d`)[t.month-12|25-n|n-d<0]for d in random.sample(range(1,26),25)]
while c:print' '.join(c[:5]);c=c[5:]
```
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 91 bytes
*-1 bytes thanks to nwellnhof*
```
.put for (("[@]"if Date.today~~/12.(0?@(^26))$/),"[ ]"xx+$0,+$0^..25)[*;*].pick(*).rotor(5)
```
[Try it online!](https://tio.run/##DcNBCoAgEADAr4h02DXZSqhLhzr0CzGISpACRQzq0tetgQl7PLucKVyJWR8ZANej4c6yaUk7Jb8tz/tWjSKohxFm1SEWFUqumeH3XRa1/M9EqkUtemEouPUAgRR98hFazPkD "Perl 6 – Try It Online")
### Explanation:
```
.put for (     ...    )         # Print for each of
          ("[@]"if Date.today~~/12.(0?@(^26))$/), # [@] if today is within the Christmas period
          "[ ]"xx+$0,     # As many [ ]s as the current date
          +$0^..25        # All the number from today to the 25th
                      [*;*]                  # Flatten
                           .pick(*)          # Randomise
                                   .rotor(5) # And split into chunks of 5
```
[Answer]
# JavaScript (ES6), ~~158 ... 150~~ 148 bytes
*Saved 2 bytes thanks to @Deckerz*
*Note: Strictly speaking, this should be marked as ES9 (ECMAScript 2018), in which the output format of `Date.prototype.toString` has been [standardized](https://www.ecma-international.org/ecma-262/9.0/#sec-date.prototype.tostring).*
```
f=(k=25,m,d=Math.random()*25+1|0,t=(new Date+0).match(/c ([01].|2[0-5])|:/)[1])=>k?(m^(m|=1<<d)?(d^t?d<t?'[ ]':d:'[@]')+`
 `[--k%5&&1]:'')+f(k,m):''
```
[Try it online!](https://tio.run/##PYzLboMwFET3/YqrSI2vA@YlsUFQuui2X2A5ioNNQojtCkwrJP6detPOZkZHR/OQ33LupuHLM@uU3tMUVrdAJy14PXsILafr4Cc5raCk13BdYZkHewNi9Q98BISHNYQZw5Q6UAKDnb2WClwPjyV8/Itk7xscm6KMTayaT@nvySStcgbpqSijfMti3@CfHWU0MdJ3d0w7QJ7lItkKnrFS0K1KKc8Fbd7GFs0Zzdbkda1oi@rsW1X7lnAQpFIV4e@C0OjyAhfO2PhaHo@5qEhAPY6xoWHunbOze@rk6W7YI6X7Lw "JavaScript (Node.js) – Try It Online")
### How?
`(new Date).toString()` returns the current date in the following format:
```
DDD MMM dd yyyy hh:mm:ss TimeZoneString
```
For instance:
```
Sun Dec 15 2019 12:29:35 GMT+0000 (Coordinated Universal Time)
```
We apply the following regular expression to this string:
```
/c ([01].|2[0-5])|:/
```
It attempts to match a day of December less than \$26\$ (it's the only month whose 3-letter abbreviation ends in "c"). If not found, we force the first `:` separator to be matched instead, in order to prevent `match()` from returning `null`.
Therefore, the variable \$t\$ (for 'today') is set to either a valid day of December, or *undefined* if we're outside the relevant period:
```
t = (new Date + 0).match(/c ([01].|2[0-5])|:/)[1]
```
\$f\$ is a recursive function that generates a random day \$d\$ in \$[1-25]\$ at each iteration and draws the corresponding slot in the calendar. It keeps track of drawn days in the bitmask \$m\$.
```
f = (                     // f is a recursive function taking:
  k = 25,                 //   k = remaining number of days to draw
  m,                      //   m = bitmask of drawn days
  d = Math.random() * 25  //   d = random day in [1-25]
      + 1 | 0,            //
  t = ...                 //   t = current day or undefined (see above)
) =>                      //
  k ?                     // if k is not equal to 0:
    ( m ^ (m |= 1 << d) ? //   if m is modified by setting the d-th bit:
        ( d ^ t ?         //     if d is not equal to t:
            d < t ?       //       if t is defined and d is less than t:
              '[ ]'       //         draw an opened window
            :             //       else:
              d           //         draw a closed window
          :               //     else:
            '[@]'         //       draw today's gift
        ) +               //
        `\n `             //     decrement k; append a linefeed at the end of a row
        [--k % 5 && 1]    //     or a space otherwise
      :                   //   else:
        ''                //     we need to pick another day: leave k unchanged and
                          //     append nothing
    ) + f(k, m)           //   append the result of a recursive call
  :                       // else:
    ''                    //   done: stop recursion
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~231~~ ~~222~~ ~~216~~ ~~202~~ ~~197~~ ~~193~~ 189 bytes
```
i=__import__
t=i("datetime").date.today()
y=t.day
d=[(((`x`,"[ ]")[x<y],"[@]")[x==y],`x`)[t.month<12or y>25]for x in i("random").sample(range(1,26),25)]
while d:print' '.join(d[:5]);d=d[5:]
```
[Try it online!](https://tio.run/##HY1BCsMgFAX3nkLcRCEEIthFGkvvIZII2uaXqCH90Hj61HY3895itoJLTvI8QU8TxC3vOE0ENXDmHQaEGJjofthh9q5wQYrGOhTiteGcz8fcMkMtE@YYi618/7PWVeopDHYxJ1zGXuadlptU9lHhoJBorewu@Rxr4@3itgZe/Rl438qLaKUSlnwWWAP1w7ZDwoY23StD4t4Myoqr196owZ7nFw "Python 2 – Try It Online")
-3 with many thanks to @AZTECCO
Examples below use an earlier version of the answer but the formula is the same.
Before December: [Try it online!](https://tio.run/##PY/BasMwEETv/oolOURqXBELHKgbldL2L4QgTrWp1VqSURbsfL0rm9LTMm92h9nhTl0Mcp6vKXpIbbB5OD/ERA/FymxLSM7jPyW1IEHRtnfGi@0bXmNC@MBP9BdMAt6jRRiTI8IAVb04IA/Vk8intF@yLPbUshHx56Yej7ywSjPGztO53GgwG66nE4kcb7J@XbVSfyAvcU3Cx0DdqZIxwWq8yNrkGjCBC3Br/dAjy998IatKeeSlrLkpxs71CLYZkgu0g534ji4wqw9NbfizVVbXjZnnXw "Python 2 – Try It Online")
December after 25th: [Try it online!](https://tio.run/##PY9Ra8MgFIXf8ysu3UN1DVIFC0vrGGz/QoTaaRZH1GDvaPrrMxvGnu493zkcONMdh5zEsvQlRyg2uXpCnHLB52ZlzqLHEP0/RfVADLOzd0Kbpw//6ePFF7j8INge6yckDgzes/NwKwHRJ@ASahDEnr@wWoG7R6fzI1pSe66Kc9o4pQkh5/ncbjSYDdXzCVl1TdVvq1bqD9QQ1chiTjicuMgFVuNVSNNXMUNIcLVxGj2po7484a040FZIaprbEEYPrptKSLiFLfvOIRGn95009OiU07Izy/IL "Python 2 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~38~~ ~~37~~ ~~32~~ ~~31~~ 30 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
žeD₂‹žfÂ‹P'@ú€…[ÿ]Dg25Ÿ«¦.r5ô»
```
-6 bytes thanks to *@Grimmy*.
[Try it online](https://tio.run/##yy9OTMpM/f//6L5Ul0dNTY8adh7dl3YYRAeoOxze9ahpzaOGZdGH98e6pBuZHt1xaPWhZXpFpoe3HNr9/z8A) or [try it online with own specified month / day](https://tio.run/##yy9OTMpM/a/km59XkmGloBSjYGikEMql5JJYaQXkAIGhqULY/0iXR01Njxp2RhwGkQHqDod3PWpa86hhWfTh/bEu6UamR3ccWn1omV6R6eEth3b//w8A).
**Explanation:**
```
že          # Push the current day
  D         # Duplicate it
   ₂‹       # Check if it's smaller than 26
     žf     # Push the current month
       Â    # Bifurcate it (short for Duplicate & Reverse copy)
        ‹   # And check if this is smaller than the month itself
            # (this will check 1-9 < 1-9 (falsey); 10 < 01 (falsey); 11 < 11 (falsey);
            #  and 12 < 21 (truthy) - so this will only be truthy for 12 / December)
         P  # Take the product of the day and both checks,
            # which result in either the day, or 0 if either check was falsey
'@         '# Push character "@"
  ú         # Pad it with the earlier number amount of spaces
   €        # Map over each of these characters:
    …[ÿ]    #  Push string "[ÿ]", where the `ÿ` is automatically filled with the character
Dg          # Duplicate the list, and pop and push its length
  25Ÿ       # Create a list in the range [length, 25]
     «      # And merge it to the earlier created list
¦           # Then remove the first item (either a "[ ]", or the "[@]" if the checks
            #                             were falsey)
 .r         # Randomly shuffle the list
   5ô       # Split the list into sublists of size 5
     »      # Join each inner list by spaces, and these strings by newlines
            # (after which the result is output implicitly)
```
[Answer]
# [R](https://www.r-project.org/), ~~113~~ 103 bytes
```
x=as.POSIXlt(Sys.time())
a=sample(25)
if(x$mo>10&(y=x$md)<26){a[a<y]="[ ]";a[a==y]="[@]"}
write(a,"",5)
```
[Try it online!](https://tio.run/##K/r/v8I2sVgvwD/YMyKnRCO4slivJDM3VUNTkyvRtjgxtyAnVcPIVJMrM02jQiU3387QQE2j0hbITNG0MTLTrE6MTrSpjLVVilaIVbIGcmxtwTyHWKVarvKizJJUjUQdJSUdU83//wE "R – Try It Online")
A full program that prints an advert calendar as specified. 
[Answer]
# [Red](http://www.red-lang.org), 135 bytes
```
d: now c: collect[repeat n 25[keep n]]if all[d/3 = 12
d/4 < 26][repeat n d/4[c/:n:"[ ]"]c/:n:"[@]"]random c
loop 5[print take/part c 5]
```
[Try it online!](https://tio.run/##RY1BCgIxEATv@4pmPxCMxkNQ8A1ehzmEzAjLxiTEwD4/rih4qqJo6KYy7irEUwtZytO8VAW5bEP8B4gesaSksVPTqqEjwzpaVSsy8/JASInEHHHFwU5iTrjAnvm/3hNF47OfCTzzT2@7fi8Rp1RKhaPaltzRw6qmhtYR4XiMNw "Red – Try It Online")
* [Before December](https://tio.run/##RY1BCsIwFAX3PcWj@5I2WsVQwTO4/fxFSL5QGpMQAx4/FhTcDcPAFPHtLp64Kzb69FQvEY@Y3s0bjNMwngc9Thc4A5dCEFepSBZbEaFn2kQyIvP6gA2BvDrgikl3Xh2xQJ/4X@@KnDLR9ATu@Ye3Hb9nuC6klDFTLmusqHYTlW2pcJi5tQ8)
* [On Christmas](https://tio.run/##RY1BCsIwEEX3PcXHfYmNVjAoeAa3wyxCZoTSmIQY8PixoODu8d@HV1X6XYV4qD5JfpqXqiDldxcHO4@THe1@OiM4hByjhkZVi/qGtGlaVQsS8/KAj5HEHHDFZAcxR1xgT/x/bxMF45LbEXjHP7xt@C0jDDHngplKXVJD86ua4mtDwMy9fwA)
* [After Christmas](https://tio.run/##RY1BCsIwEEX3PcXHfYmNVjAoeAa3wyxCZoTSmIQY8PixoODu8XmfV1X6XYV4qD5JfpqXqiDldxcHexonO9r9dEZwCDlGDY2qFvUNCXamVbUgMS8P@BhJzAFXTHYQc8Rl@/Pf3iYKxiW3I/COf3jb8FtGGGLOBTOVuqSG5lc1xdeGgJl7/wA)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~76~~ 75 bytes
```
⁶o”@;Ø[jⱮ;@Jị@
“j⁶ṖgqS^OßƭẸ#pÆẸ¥aRŀçĠrṬỤ{½9?ȷ²Yḅ»ḲḢ;Ɱ$ŒV12;Ɱ25¤i+Ɱ25ẊÇs5K€Y
```
[Try it online!](https://tio.run/##y0rNyan8//9R47b8Rw1zHawPz4jOerRxnbWD18Pd3Q5cjxrmZAHlHu6cll4YHOd/eP6xtQ937VAuONwGpA4tTQw62nB4@ZEFRQ93rnm4e0n1ob2W9ie2H9oU@XBH66HdD3dserhjkTXQOJWjk8IMjUAsI9NDSzK1wYyHu7oOtxebej9qWhP5/z8A "Jelly – Try It Online")
A full program that prints an advent calendar. Longer than most Jelly programs because it has to call `__import__('datetime').datetime.today().month` and `__import__('datetime').datetime.today().day` in Python. 
If the date and time could be provided as an argument, it could be much shorter:
# [Jelly](https://github.com/DennisMitchell/jelly), ~~35~~ 34 bytes
```
⁶o”@;Ø[jⱮ;@Jị@
12;Ɱ25¤i+Ɱ25ẊÇs5K€Y
```
[Try it online!](https://tio.run/##y0rNyan8//9R47b8Rw1zHawPz4jOerRxnbWD18Pd3Q5chkbWQJ6R6aElmdpgxsNdXYfbi029HzWtifz//7@hkY6hGQA "Jelly – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 112 bytes
```
x=[*1..25].shuffle;5.times{|c|puts x[c*5,5].map{|w|['[@]','[ ]',w][((d=Time.now).day-(d.month-12)*30)<=>w]}*" "}
```
[Try it online!](https://tio.run/##KypNqvz/v8I2WstQT8/INFavOKM0LS0n1dpUryQzN7W4uia5pqC0pFihIjpZy1QHqCA3saC6prwmWj3aIVZdRz1aAUiWx0ZraKTYhgB16OXll2vqpSRW6mqk6OXm55Vk6BoaaWoZG2ja2NqVx9ZqKSko1f7/DwA "Ruby – Try It Online")
[Answer]
# [C#](https://docs.microsoft.com/de-de/dotnet/csharp/), 267 bytes
```
using System;using System.Linq;class _{static void Main(){var n=DateTime.Now;var t=n.Month==12?n.Day:0;Console.WriteLine(string.Join(" ",Enumerable.Range(1,25).OrderBy(_=>new Random().Next(-9,9)).Select((d,i)=>(i%5==0?"\r\n":"")+(d<t?$"[ ]":d>t?$"{d}":"[@]"))));}}
```
[.Net Fiddle](https://dotnetfiddle.net/JDNqlm)
]