This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func containsEmoji(text: String) -> Bool { | |
var containsEmoji = false | |
for scalar in text.unicodeScalars { | |
switch scalar.value { | |
case 0x1F600...0x1F64F: | |
// Emoticons | |
containsEmoji = true | |
case 0x1F300...0x1F5FF: | |
// Misc Symbols and Pictographs | |
containsEmoji = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Find the starting Monday for the given week (or for the current week if no date is passed) | |
* | |
* This is required as strtotime considers Sunday the first day of a week, | |
* making strtotime('Monday this week') on a Sunday return the adjacent Monday | |
* instead of the previous one. | |
* | |
* @param string|\DateTime|null $date |