[Question]
  [
Sometimes, I will think it is one day of the week (e.g Friday) when in reality, it's earlier in the week (e.g Tuesday).
Your challenge is to display the number of days my estimates are off by.
## Challenge
Given a day of the week I think it is, and the day of the week it actually is, output/return the number of days between the two.
## Test Cases
```
Incorrect date, Actual Date -> Days between
Monday, Monday -> 0
Friday, Tuesday ->  3
Saturday, Sunday -> 6
Tuesday, Friday -> 4
Thursday, Wednesday ->  1
Monday, Friday -> 3
```
## Rules
* Dates have to be taken as the actual date name (`Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday` and `Sunday`). This is non-negotiable.
* Date names must be taken as strings or equivalent in your language (ADTs aren't allowed unless they store their values as the allowed strings)
* Input and output can be given/taken in any reasonable format.
* Full program or function - it doesn't matter.
And finally, this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the answer in each language with the fewest bytes wins.
  
[Answer]
# JavaScript (ES6), 48 bytes
Expects `(day1)(day2)`.
```
a=>b=>((g=s=>parseInt(s,34)%72%23)(a)-g(b)+21)%7
```
[Try it online!](https://tio.run/##dc9NC4JAEAbgu79CBGGXMvODOq3HoEMng86jrpshu7LrBv36bRFTM5rTMDy8M/OAJ6hSNl0fcFFRUxMDJCtIhhAjimQdSEXPvEdqm6TYP8Z@nGAEOGCowJs4siNTCq5ES3etYKhG3kXwCl4enjvsDhWG7t5Z4ZNsRnzVVC20xcka59BrOfJcL7ItPqzxlDcvmZLTH3zX8qNvtOLTKRZHzt8Hv4OHm80b "JavaScript (Node.js) ‚Äì Try It Online")
### How?
We need a hash function \$g\$ that turns a day string into an index. The results of this function are actually quite flexible:
* They can be in ascending or descending order: `0,1,2,3,4,5,6` or `6,5,4,3,2,1,0`. (We'll have to compute either \$g(a)-g(b)\$ or \$g(b)-g(a)\$ accordingly.)
* Day #0 may be any day of the week. For instance, `3,4,5,6,0,1,2` or `4,3,2,1,0,6,5` are also valid.
* The results may be greater than \$6\$ as long as they are correct modulo \$7\$. Because the sign of the modulo is the sign of the dividend in JS, we'll have to do something like `(g(a) - g(b) + k) % 7` anyway, where \$k\$ is a large enough multiple of \$7\$.
The following function was found by brute-force:
```
g = s => parseInt(s, 34) % 72 % 23
```
which gives:
```
 day         | base34 -> dec | mod 72 | mod 23 | mod 7
-------------+---------------+--------+--------+-------
 "Monday"    |      30369728 |   56   |   10   |   3
 "Tuesday"   |    1358300452 |    4   |    4   |   4
 "Wednesday" | 1702996445748 |   12   |   12   |   5
 "Thursday"  |   45612914380 |   52   |    6   |   6
 "Friday"    |      21127508 |   44   |   21   |   0
 "Saturday"  |   43748842416 |   24   |    1   |   1
 "Sunday"    |      38623568 |   32   |    9   |   2
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/) + GNU utilities, 26
```
date -f- +%u|dc -e??-7+7%p
```
Inputs are read from lines 1 and 2 of STDIN.
[Try it online!](https://tio.run/##TYw9D4JADIb3/op3kERDbmZwYHNzgsS50JIjMZw5uBgD/PbTAwa7tM/70YZHG7vzBXMUnhSmM8izsEgLo2VpirzIXnGlt@2fCq8sYDRXiKOZ8BttrcOJ/@6GVizoSNyg8e4G4Q/2RTffJ6qDjgkrnoJPQhU2@9Cxx6i2wW/8UBn2xvHuCHwB "Bash ‚Äì Try It Online")
### Explanation
GNU `date` reads a *mostly free format human readable date string*. With `-f` it reads multiple date strings from a file and if the file is `-`, STDIN is read. The *free format* is free enough that a single day of the week will be parsed. The parsed date is then output according to the format string. `%u` simply outputs the {1..7} numerical index of the day of the week, where 1 is "Monday".
This output is piped to a `dc` expression:
```
??          # read the first 2 converted inputted dates
  -         # find the difference
   7+       # add 7
     7%     # find the modulo-7
       p    # print the result
```
[Answer]
# [Python 2](https://docs.python.org/2/), 42 bytes
```
lambda a,b:(hash(b*11)%69-hash(a*11)%69)%7
```
[Try it online!](https://tio.run/##RY3BCsIwDIbvfYpcZK1UcSqKg3r05knBiyAZ22hhdqVrGXv6unUbnpL/y5fE9E42eh8q8Q41fvMCAXmeUYmtpPk6TdnqdNnEhHNiq3PopKpLSDMCShsOjXcGBFjsPkP2jrJta2rlaAKbKySMLIbSjo7tQJBDHolZXB5NYwcJKjrOGQgRV8O90QX2HKY6Xt2Rm1WRPX3ZzhAO5IHO28gffnFPZHY4TEsjPJKn9Hair7LQ/yMpWd797cMP "Python 2 ‚Äì Try It Online")
If we can map both weekdays to their respective values (`Monday -> 0, Tuesday -> 1, ...`), then we can calculate the days in between with \$ (a - b) \bmod 7 \$. To do this, we use the following formula: `hash(s*11)%69%7`.
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), ~~32~~ 26 bytes
**Solution:**
```
7!-/13 1 0 2 12 7 5?15!+/'
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NylxRV9/QWMFQwUDBSMHQSMFcwdTe0FRRW1/9f5q6hoaSb35eSmKlkjWMoWmtoeRWlAkRCylNLYYJBieWlBZBhINL4UphKqxhmsCCGaVFUNHw1JQ8hBlwy2CKNbn@AwA "K (ngn/k) ‚Äì Try It Online")
**Explanation:**
Found a slightly better lookup. Sum of ASCII chars modulo 15.
```
7!-/13 1 0 2 12 7 5?15!+/' / the solution
                       +/' / sum (+/) each (') input string
                    15!    / 15 modulo result
                   ?       / lookup this value in left list
    13 1 0 2 12 7 5        / precalculated result of summing ASCII weekdays
  -/                       / subtract to get difference
7!                         / modulo 7 to account for negatives
```
**Edits:**
* **-6 bytes** Lookup table based on sums of ascii chars, rather than `Mo/Tu/We` etc.
[Answer]
# [Factor](https://factorcode.org/), 35 bytes
```
[ [ day-names index ] bi@ - 7 rem ]
```
Doesn't run on TIO because TIO is missing the `calendar.english` vocabulary which is perfectly extant on a local copy of Factor 0.98. So have a screenshot of running the quotation in the listener:
[![enter image description here](https://i.stack.imgur.com/iPr2w.png)](https://i.stack.imgur.com/iPr2w.png)
## Explanation:
It's a quotation (anonymous function) that takes two strings on the data stack as input and leaves an integer on the data stack as output. Assuming `"Tuesday" "Friday"` is on the data stack when this quotation is called...
* `[ day-names index ]` Push a quotation for `bi@` to use later.
**Stack:** `"Tuesday" "Friday" [ day-names index ]`
* `bi@` Apply a quotation to two objects. Inside the quotation now...
**Stack:** `"Tuesday"`
* `day-names` Push a sequence containing the days of the week.
**Stack:** `"Tuesday" { "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" }`
* `index` Take an object and a sequence and return the index of that object in the sequence.
**Stack:** `2`
* Now `bi@` will do the same with the other input.
**Stack:** `2 5`
* `-` Subtract.
**Stack:** `-3`
* `7` Push `7` to the stack.
**Stack:** `-3 7`
* `rem` Like `mod`, except the result is always positive.
**Stack:** `4`
[Answer]
# [Emotilang](https://knosmos.github.io/emotilang/), 1,312 bytes
([Github repo](https://github.com/knosmos/emotilang))
Input is from the first and second lines of STDIN.
```
üì¶‚úèÔ∏èüí¨üìúüìú
ü§îüì¶‚öñÔ∏èüìú‚ôèÔ∏èüÖæÔ∏è‚ôëÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïõüíØ
ü§îüì¶‚öñÔ∏èüìú‚úùÔ∏è‚õéüìßüí≤‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïêüíØ
ü§îüì¶‚öñÔ∏èüìú„Ä∞Ô∏èüìß‚Ü©Ô∏è‚ôëÔ∏èüìßüí≤‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïëüíØ
ü§îüì¶‚öñÔ∏èüìú‚úùÔ∏è‚ôìÔ∏è‚õé¬ÆÔ∏èüí≤‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïíüíØ
ü§îüì¶‚öñÔ∏èüìúüéè¬ÆÔ∏èüïØÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïìüíØ
ü§îüì¶‚öñÔ∏èüìúüí≤üÖ∞Ô∏è‚úùÔ∏è‚õé¬ÆÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïîüíØ
ü§îüì¶‚öñÔ∏èüìúüí≤‚õé‚ôëÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
üì¶‚úèÔ∏èüíØüïïüíØ
‚öóÔ∏è‚úèÔ∏èüí¨üìúüìú
ü§î‚öóÔ∏è‚öñÔ∏èüìú‚ôèÔ∏èüÖæÔ∏è‚ôëÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïõüíØ
ü§î‚öóÔ∏è‚öñÔ∏èüìú‚úùÔ∏è‚õéüìßüí≤‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïêüíØ
ü§î‚öóÔ∏è‚öñÔ∏èüìú„Ä∞Ô∏èüìß‚Ü©Ô∏è‚ôëÔ∏èüìßüí≤‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïëüíØ
ü§î‚öóÔ∏è‚öñÔ∏èüìú‚úùÔ∏è‚ôìÔ∏è‚õé¬ÆÔ∏èüí≤‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïíüíØ
ü§î‚öóÔ∏è‚öñÔ∏èüìúüéè¬ÆÔ∏èüïØÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïìüíØ
ü§î‚öóÔ∏è‚öñÔ∏èüìúüí≤üÖ∞Ô∏è‚úùÔ∏è‚õé¬ÆÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïîüíØ
ü§î‚öóÔ∏è‚öñÔ∏èüìúüí≤‚õé‚ôëÔ∏è‚Ü©Ô∏èüÖ∞Ô∏èüíπüìú
‚öóÔ∏è‚úèÔ∏èüíØüïïüíØ
üß∫‚úèÔ∏èüì¶‚ûñ‚öóÔ∏è
üß∫‚úèÔ∏èüß∫üçáüíØüïñüíØ
üñ®Ô∏èüß∫
```
[Online interpreter](https://knosmos.github.io/emotilang/interpreter.html)
Here is proof that it passes the test cases:
[![enter image description here](https://i.stack.imgur.com/A1KKS.jpg)](https://i.stack.imgur.com/A1KKS.jpg)
[Answer]
# [Pari/GP](http://pari.math.u-bordeaux.fr/), 114 bytes
```
v(s,n)=1+Vecsmall(s)[n]%4;
m=[5,x,x,7;3,2,6,1;x,x,x,x;x,x,x,4];
d(n)=m[v(n,6),v(n,1)];
p(a,b)=print((d(a)-d(b))%7)
```
Explanation:
Pari/GP doesn't have calendar functions or, really, much in the way of string processing. I use the ASCII values of the 1st and 6th characters of the weekday name to index into a 4x4 matrix that encodes the weekday numbers, and then I just print the forward difference. I'm pleased with my solution, but there's probably a shorter formula I didn't think of.
[Try it online!](https://tio.run/##TY29DoJAEIR7HoOEZDcuBYpYXGjtrDBaIMXhoZLAebkDgk@Pp/xotpjdLzOziuvSv6vhFl@GDgxJjIPVqbiamlcVGExl5oXMqeN0S72dHdvQmiIKWP@9@0nDjDkCbLpOO5AUIX0kQIsVcMoxVrqUDYAAjr6AHNHb4aDAPTyl4C@X5gVtwN3rcoTHtjALTXjT6pEn7c88e2iOjfTR6gmfCyH/apaPi314Aw "Pari/GP ‚Äì Try It Online")
[Answer]
# Ruby, 91 bytes
```
require"date"
w=(0..6).map{|i|Date.jd(i).strftime"%A"}
f=->i,a{(w.index(i)-w.index(a)+7)%7}
```
Testing:
```
p f["Saturday", "Sunday"]   #=> 6
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 16 bytes
```
OP‚Ç¨%647%154%8I%7
```
[Try it online!](https://tio.run/##y0rNyan8/98/4FHTGlUzE3NVQ1MTVQtPVfP/h9uBQv//R0cr@ebnpSRWKukowFixOgrRSm5FmVDRkNLUYrhwcGJJaRFUIrgUoRymCCgM1QkRzigtgomHp6bkIZmEsBamIRYA "Jelly ‚Äì Try It Online")
-2 bytes thanks to Arnauld via finding the modulo chain to get the right values
Previously:
# [Jelly](https://github.com/DennisMitchell/jelly), 18 bytes
```
OP‚Ç¨%17·∏§·ªã‚Äú√ò·ª¥¬¶‚ÄôD¬§I%7
```
[Try it online!](https://tio.run/##y0rNyan8/98/4FHTGlVD84c7ljzc3f2oYc7hGQ93bzm07FHDTJdDSzxVzf8fbgeq@P8/OlrJNz8vJbFSSUcBxorVUYhWcivKhIqGlKYWw4WDE0tKi6ASwaUI5TBFQGGoTohwRmkRTDw8NSUPySSEtTANsQA "Jelly ‚Äì Try It Online")
Not convinced this is a good way of doing it, lol.
-2 bytes using integer compressing (thanks Lyxal)
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~43~~ 41 bytes
-2 bytes thanks @Zaelin Goodman
```
$x,$y=$args|%{+[dayofweek]$_}
($x-$y+7)%7
```
[Try it online!](https://tio.run/##XZBdS8MwFIbv8yvORWpb1oGibFeDiSJ4IYoVvBhj1PbMqbWZ@WAtXX97TdN0seYqyfN@HM6eHZCLHeZ5S7ewgLqlZUSrBU34uzh69WSVJRXbHhC/1nTTkICWU1pN5qE3bxtClgGJAv@BFVrlRzDcIILzsCN3/MOSF4XCIrg0LE6k4pbGavDNDBvUGtkIja56tFN8YK@YFS72IhwP45y6MIQjeFAT0IfeFynjHFN5m0iMgF6nUiW5fWC51wQzvQ266fUchcql/jjTSxq7/5qNePUU3ygh2ffj26fWrJd9Z3dilaYoRBdsE6f44wpPOv/UAF2s3xlGpU7ZlzvZv2GM5tl0@a7WoIY07S8 "PowerShell ‚Äì Try It Online")
[Answer]
# [Java (JDK)](http://jdk.java.net/), 35 bytes
```
i->a->(7+a.ordinal()-i.ordinal())%7
```
[Try it online!](https://tio.run/##fY/BSsRADIbvfYqwUJhqO@hpwWpBEMGDeFjBg3iI7cyS7nSmzKSFIn32Wnfr7oLgJcmffPxJauwxq6vdRE3rPEM9a8nUKHmRR@e9jslI3dmSydmfYWkwBHhGsvAVAbTdp6ESAiPPqXdUQTPPxIY92e37B6DfhmSPAjwuPrcPOLzoN6V26at7svy3XxSg4W6irMCsEOtLlM5XZNGIJKNTncTrKd9ba@dB9OiBbOm8VyXfwNFN9mg6FWZ@OeSMx5I7NP/DAJshsGqk61i282OsxSq@vgqQFXDMVWxX6Wl/ulinoCW2rRnEQScHdR/mx8WRTpJ8WTZGv3GMxukb "Java (JDK) ‚Äì Try It Online")
Call is done like this:
```
    f.apply(MONDAY).applyAsInt(TUESDAY);
```
---
Since the answer above is not of the taste of some, here's a more "Java is verbose" answer that takes strings as input rather than built-in constants:
# [Java (JDK)](http://jdk.java.net/), 113 bytes
```
i->a->(java.util.Comparator.comparing((String s)->java.time.DayOfWeek.valueOf(s.toUpperCase())).compare(a,i)+7)%7
```
[Try it online!](https://tio.run/##XVHLasMwELz7KxZDQGpt0Z4CTWMoKYEeQg5JyaH0sLXlVIktGT1cTPC3u44fSchFO7sz2tmVDlhieEiOjcgLpS0c2pxZkXP2MPNua86KjKVOxlYoeSbjDI2BFQoJJw@gcD@ZiMFYtG0olUggbzmysVrI/dc3oN4b2kkBlkOf154NtupD2rtiFEEK80aEEYYRuc6wUHmBGq3SLO5gqyWDDRgaRtcV3rFapzvOj6zEzPF1Sgyz6rMouF6g4YRSOvTgBANBH6d0Mm1m3YglakiwMjAHyf9gXOPkr5Rs637gbx03PdrxRI54@@v0AJda9GCD1ukBuu523ZukSgM5OwkZK615bF860/GdbhQYW4fZPQ2wqYzlOVPOsqId0abEnzw/GQgjuMRkIv3g6hEMzQJIGRZFVpE@p332ZtrPIBc1pbPBrPbGs/bq5h8 "Java (JDK) ‚Äì Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~10~~ 9 bytes
```
23Y2&md7\
```
Inputs are in reverse order. [Try it online!](https://tio.run/##y00syfn/38g40kgtN8U85v//avWQ0tTilMRKdR0FdbeiTBCrFgA) Or [verify all test cases](https://tio.run/##y00syfmf8N/IONJILTfFPOa/S8j/anXf/LyUxEp1HQUYq5arWj2kNLUYKupWlAkTDS6FKQ1OLCktgglDVQCFYdpAouGpKXlwQ0IySouKMdXDbAQA).
### Explanation
```
      % Implicit input: cell array of two strings 
23Y2  % Push predefined literal {'Monday', 'Tuesday', 'Wednesday', 'Thursday', ...
      % 'Friday', 'Saturday', 'Sunday'}
&m    % Indices of membership. Gives a vector of two numbers
d     % Consecutive differences. Gives one number
7     % Push 7
\     % Modulus
      % Implicit display
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 20 bytes
```
%-Fmx"SMansFr"@d12Q7
```
[Test suite](http://pythtemp.herokuapp.com/?code=%25-Fmx%22SMansFr%22%40d12Q7&test_suite=1&test_suite_input=%22Monday%22%2C+%22Monday%22%0A%22Friday%22%2C+%22Tuesday%22%0A%22Saturday%22%2C+%22Sunday%22%0A%22Tuesday%22%2C+%22Friday%22%0A%22Thursday%22%2C+%22Wednesday%22%0A%22Monday%22%2C+%22Friday%22&debug=0)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 42 bytes
```
T`aF\hWsMn`d
\w+
$*
,
,7$*
(1*),\1|1{7}
1
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wPyQh0S0mI7zYNy8hhSumXJtLRYtLh0vHHEhpGGpp6sQY1hhWm9dycRn@/@@bn5eSWKkDobjcijJBvJDS1GIQNzixpLQIJBBcCpaGiutAlHGFZJQWgfnhqSl5EB1Q4yAKAA "Retina 0.8.2 ‚Äì Try It Online") Link includes test cases. Explanation:
```
T`aF\hWsMn`d
\w+
$*
```
Convert the day name to a day number. This works as follows: Certain letters in the days are replaced with digits from `0` to `6`. No two digits are adjacent, and the first digit is always the correct digit for the day of the week (but descending, because the inputs are in reverse order). When I ask Retina to convert from decimal to unary, it only sees the first digit, and so gives me the desired result.
```
,
,7$*
```
Add 7 to the second number so that it is always greater than the first.
```
(1*),\1|1{7}
```
Take the difference between the numbers and reduce modulo 7.
```
1
```
Convert to decimal.
Table of day names and their conversions:
```
Sunday          Su6d0y          6
Monday          5o6d0y          5
Tuesday         Tue4d0y         4
Wednesday       3ed6e4d0y       3
Thursday        T2ur4d0y        2
Friday          1rid0y          1
Saturday        S0turd0y        0
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~18~~ ~~17~~ ~~15~~ 11 bytes
```
C813%60%√Ü7%
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f2cLQWNXMQPVwm7nq///RSuGpKXmpxSmJlUo6CkohGaVFYHYsAA "05AB1E ‚Äì Try It Online")
[Try all test cases](https://tio.run/##yy9OTMpM/f/f2cLQWNXMQPVwm7nq///R0Uq@@XkpiZVKOgowVqyOQrRSSGlqMVTYrSgTLhxcClMcnFhSWgQXh6oBisM0goXDU1Py4OaEZJQWFWPRAbM2FgA "05AB1E ‚Äì Try It Online")
Takes input as a list, in order [actual date, incorrect date]
I'm not sure exactly how 05AB1E `C` command works for non binary strings, I just tried some stuff and it worked
uses a hash to map the days to `[4, 3, 2, 1, 0, 6, 5]` (mod 7, since we do mod 7 anyway after the subtraction). The modulos were found by brute-force
```
["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
after C:
[2184, 5008, 18736, 9824, 1968, 9256, 2472]
after 813%:
[558, 130, 37, 68, 342, 313, 33]
after 60%:
[18, 10, 37, 8, 42, 13, 33]
after 7%:
[4, 3, 2, 1, 0, 6, 5]
```
[Answer]
# [J](http://jsoftware.com/), 37 34 bytes
```
7|-&((678 A.i.7)i.7|318+`-/@$3&u:)
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/zWt01TQ0zMwtFBz1MvXMNYG4xtjQQjtBV99BxVit1ErzvyYXV2pyRj5Qk62Cum9@XkpipbpCGpwJkTQGSboVZcIkQ0pTixGyZiDZ4MSS0iKYfHApkmYTkDRMB0gWahBE1hAsm1FaBJcOT03JQzbeGM1lUO3/AQ "J ‚Äì Try It Online")
* `3&u:` Convert chars to unicode numbers
* `318...$` Reshape cyclically to length 318. I found this by brute forcing a number such that the next step will return unique numbers for each weekday.
* `+`-/` Reduce by placing `+` and `-` alternately between the numbers.
* `7|` Mod 7
* `(678 A.i.7)i.` Find index of above two numbers within `0 6 4 2 1 3 5`, which are the unique numbers the weekdays map to.
* `-&` Subtract after converting both args.
* `7|` Mod 7
## [J](http://jsoftware.com/), staightforward approach, 35 bytes
```
7|-&('MoTuWeThFrSaSu'-:@I.@E.~2&{.)
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/zWt01TTUffNDSsNTQzLcioITg0vVda0cPPUcXPXqjNSq9TT/a3JxpSZn5AN12SoAlealJFaqK6TBmRBJY5CkW1EmTDKkNLUYIWsGkg1OLCktgskHlyJpNgFJw3SAZKEGQWQNwbIZpUVw6fDUlDxk443RXAbV/h8A "J ‚Äì Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
‚ÅΩAe,8·∏•)I%7
```
A monadic Link accepting a list of two lists of characters `[incorrect, actual]` yields an integer in \$[0,6]\$ wrapped in a list.  
When run as a full program this accepts a list of two strings and prints the resulting integer (since Jelly's representation of a list containing one element is just the representation of that element).
**[Try it online!](https://tio.run/##y0rNyan8//9R417HVB2LhzuWanqqmv///z9a3a0oMyWxUl1HQT2kNLUYxIwFAA "Jelly ‚Äì Try It Online")**
### How?
Hashes `"Thursday"` to `1`, `"Wednesday"` to `2`, ..., `"Friday"` to 7, then takes the difference modulo \$7\$.
```
‚ÅΩAe,8·∏•)I%7 - Link: list of lists of characters, [incorrect, actual]
      )    - for each (day in [incorrect, actual]):
‚ÅΩAe        -   17352
    8      -   eight
   ,       -   pair -> [17352, 8]
     ·∏•     -   hash (day) using a salt of 17352 and a domain of [1..8]
       I   - differences
        %7 - mod seven -> [(·∏•(incorrect) - ·∏•(actual)) mod 7]
           - implicit print (of Jelly representation of that)
```
---
### Alternative 10 byter
```
O·∏Ö»∑%‚ÅΩ‚Ç¨∆àI%7
```
(Same IO as the above.)
[Try it online!](https://tio.run/##y0rNyan8/9//4Y7WE9tVHzXufdS05liHp6r5/8PtQOb//9HR6r75eSmJleo6CjBWLJdOtLpbUSZUNKQ0tRguHJxYUloElQguRSiHKQIKQ3VChDNKi2Di4akpeUgmIayFa4gFAA "Jelly ‚Äì Try It Online")
Maps `"Thursday"` to `0`, `"Wednesday"` to `1`, ..., `"Friday"` to `6`, then takes the difference modulo \$7\$.
```
O·∏Ö»∑%‚ÅΩ‚Ç¨∆àI%7 - Link: list of lists of characters, [incorrect, actual]
O          - convert to a list of lists of ordinals
  »∑        - 1000
 ·∏Ö         - convert from base (1000) to an integer (vectorises)
    ‚ÅΩ‚Ç¨∆à    - 4157
   %       - modulo (4157) (vectorises)
       I   - differences
        %7 - modulo seven
           - implicit print (of Jelly representation of that)
```
[Answer]
# [R](https://www.r-project.org/), 78 bytes
```
function(x)diff(which(t(sapply(w,grepl,x))))%%7
w=scan(,'')
M Tu W Th F Sa Su
```
[Try it online!](https://tio.run/##dY@xCoMwGIT3PEVIERPIXii4ujkpOEqMSQ2NiSQG9emtVit16E0f93P3c25p2OwrK2VVz8kig@GDsgZPpFFS4rFVvMUD9qzv9YxH@nSi13Qiq6LoDsbEc2YwjWMCMlgEWMKihSnMGcwD@O3GHKPMmtVBFBVtcH5DQgC4QaY15LarlWHbc/8AoxCvLZxcUkH4nUrRmC@fXRSlTu2QsyG4A8MnTcB3wtFMz6mDJX9v0tmOXFdsFl0zq5Y3 "R ‚Äì Try It Online")
Well, actually [76 bytes](https://tio.run/##dY89C4MwGIT3/IpgERPIXii4ujkpOEqMSROqieQD9ddbrVbq0Jse7uXu5ezS0tnVRoi6mdNFBM28MhpNuFVCoFEqJpFHjg5DN6ORPC0fOjLhVXF8B2PqGNWIJAkGOSwDrKCEGfSwCOC3GTEU5UavTkSiUgbrNsQYgBukXQeZ6Rul6fbaPcDI@WsLp5dU4G6nirf6y2cXiTKrdiioD/bA8Elj8B1wNJNzqDf4701Y0@Pris0ia2bV8gY) because we could use `M Tu W h F t Su` as a shorter lookup vector, but I feel the obviousness of the code is worth the extra +2.
---
# [R](https://www.r-project.org/), 80 bytes
```
function(a,b,`+`=function(d)sum(utf8ToInt(d)*169^(nchar(d):1-1))%%467)(+a-+b)%%7
```
[Try it online!](https://tio.run/##bY9NC4JAEIbv/goxhJ1cD0JYCV6DDp0SuqWr7qKku7IfhL/etMw8dHueF@adGTmUpFepYCzN@3hghhe6FhwRnOPMy@IlKEGZFhnNDok4cz36NgiPd8SLisjRosAPAFx3F@4BecT38lH263bkXAQf3cHOlWgjJwTL2tikaexCtHnNybRKRdaT0kdc/AZsJzFUzXijJV8kqYz88knWMy39Exv@2aRI1zU9mrrx8pYW8DdnUrSwPl4L/M4Ahhc "R ‚Äì Try It Online")
Interprets ASCII values in each string as base-169 digits, then evaluates (incorrectly due to floating-point errors, but the incorrectness is taken into account by the program) modulo 467. This converts the days of the week to `5 6 0 1 2 3 4` on the TIO installation of [R](https://www.r-project.org/).
Somehow my own installation of [R](https://www.r-project.org/) evaluates incorrectly differently, requiring interpretation in base-134 and evaluation modulo 978 (to correct the incorrectness), but both programs come out at 80 bytes.
[Answer]
# [Red](http://www.red-lang.org), 70 bytes
```
func[a b][g: func[d][index? find system/locale/days d](g a)-(g b)// 7]
```
[Try it online!](https://tio.run/##TY4/D4IwEMV3PsWlkySSRhcTBt3cXMTEobmh0CuQYDEtTeTTY8P/G@56v77XPktqeJISGOl00N4UQkKOokxhXBSK2ij63UCHCa53HX140xayIa5k70DhoQQZJ6HnMedwwUG3lmRRgQiCE4R2RhFBKPZoTVjZepjo3dYTfXlyG85k5@10kfmdfFGtxhlX3s78TcrsX1q/XQwovrY23ZyQHdmYElhyZaBhi43DHw "Red ‚Äì Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 22 bytes
Going with the numeric modulo would probably be shorter, but I enjoyed this more.
```
¬£7√Ü√êTTX √Ö√Éb_√∏X¬Ø3
r- u7
```
Explanation:
```
¬£7√Ü√êTTX √Ö√Éb_√∏X¬Ø3
 7√Ü              // Generate the range [0..6] and map it to 
   √êTTX          // new Date(0, 0, X)
        √Ö√É       // stringified such as "Sun Dec 31 1899", "Mon Jan 01 1900" etc.
¬£                // For every input string,
          b_     // map to the index of the item that
            √∏X¬Ø3 // contains the first three letters of the input.
r- u7            // Reduce with subtraction, positive modulo 7.
```
[Try it here.](https://ethproductions.github.io/japt/?v=1.4.6&code=ozfG0FRUWCDFw2Jf+FivMwpyLSB1Nw==&input=WyJTYXR1cmRheSIsICJTdW5kYXkiXQ==)
[Answer]
# [R](https://www.r-project.org/), ~~68~~ ~~66~~ 53 bytes
```
function(x)diff(match(x,weekdays(Sys.Date()+0:6)))%%7
```
[Try it online!](https://tio.run/##K/qfkl8en5KZlqZg@z@tNC@5JDM/T6NCEySikZtYkpyhUaFTnpqanZJYWawRXFms55JYkqqhqW1gZaapqamqag43QCNZQ8k3Pw@oUEkHxtDUVFbQtVMw4EJWFFKaWgxR5VaUiaRKwRhFWXAp1KzgxJLSIiR1ZijKoGbowI2FqjJBURWempIHszUko7QIWaWCIXYDUf1g/B8A "R ‚Äì Try It Online")
Depends on system locale.
*-13 bytes thanks to [@Dominic](https://codegolf.stackexchange.com/users/95126/dominic-van-essen) making it work for edge cases*
[Answer]
# Excel, 69 bytes
```
=LET(s,TEXT(SEQUENCE(7),"dddd"),MOD(MATCH(A1,s,0)-MATCH(B1,s,0)+7,7))
```
Input is in the cells `A1` and `B1`. The formula goes anywhere else.
`LET(s,TEXT(SEQUENCE(7),"dddd")` stores an array of day names so we can reference it using just `s`.  
`MATCH(A1,s,0)` & `MATCH(B1,s,0)` finds the input day names in that array.  
`MOD(MATCH(~)-MATCH(~)+7,7)` finds the distance from the second day (`B1`) to the first (`A1`).  
The `MOD(~+7,7)` is necessary because Mon‚ÜíFri is in the same week but Fri‚ÜíMon spans two weeks.
[![Screenshot](https://i.stack.imgur.com/hUe2F.png)](https://i.stack.imgur.com/hUe2F.png)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~28~~ 21 bytes
```
‚âî‚Å∞Œ∑Ôº¶¬≤‚â¶‚ÅªÔπ™‚çòÔº≥Œ≥‚Å∏‚Å¥‚Åπ‚Å∞‚Å∑Œ∑Ôº©Ôπ™Œ∑‚Å∑
```
[Try it online!](https://tio.run/##LYzLCoMwFET3fsXF1Q2kINrqwpUtFIQGCu0PBBNNQBLJo7Rfn4baxTAwhzmT4m6yfE1p8F4vBisKivTFbB1gTYDxbQc3OQdk2kRP4cJ9wCGMRsg3lm11rJvu1JYUmBVxtXjmXuJothgewWmzIKEw59QNIWT33/Me8Cf6nxSFLuM@pWeUXvBPcXU6Vzq81i8 "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Edit: Saved 7 bytes thanks to @DominicvanEssen by searching for a suitable base and large modulus which generates descending integers directly instead of needing a look-up table. Explanation:
```
‚âî‚Å∞Œ∑
```
Initialise the accumulator to zero.
```
Ôº¶¬≤
```
Loop over the two days.
```
‚â¶‚ÅªÔπ™‚çòÔº≥Œ≥‚Å∏‚Å¥‚Åπ‚Å∞‚Å∑Œ∑
```
Interpret the day name as a base 95 number (this is the index into printable ASCII). The number is then reduced modulo 84907 and later modulo 7, which was chosen to result in counting downwards from Thursday so that the result is the desired sign. The accumulator is subtracted from this value, so that on the first pass the accumulator becomes the first day and on the second pass it becomes the difference.
```
Ôº©Ôπ™Œ∑‚Å∑
```
Reduce the difference modulo 7 to account for wrapping past the end of the week.
[Answer]
# [Lua](https://www.lua.org/), 72 bytes
```
a,_,b=io.read(2,"l",2)w="SuMoTuWeThFrSa"print((w:find(a)-w:find(b))/2%7)
```
[Try it online!](https://tio.run/##yylN/P8/USdeJ8k2M1@vKDUxRcNIRylHScdIs9xWKbjUNz@kNDw1JMOtKDhRqaAoM69EQ6PcKi0zL0UjUVMXykrS1NQ3UjXX/P/frSgzJbGSK6Q0tRhIAwA "Lua ‚Äì Try It Online")
### Explanation
```
a,_,b=io.read(2,"l",2)
```
Take first 2 bytes of each input, discarding rest of first input, and ignoring rest of second. This leaves the remaining input, so running this twice without refreshing the environment (e.g. in a `lua` console) will not work. This could be resolved by adding `,"l"` to the `read` (+4 bytes).
To make this compatible with older Lua versions, change `l` to `*l` (+1 byte).
```
(w:find(a)-w:find(b))/2%7
```
`find` returns the index at which the input was found. `w` being `SuMoTuWeThFrSa`, representing the smallest possible unique letter representation of each day. Find the difference in indexes, divide by two (string length of 14), and modulo by 7.
]