@@ -13,7 +13,6 @@ import clsx from 'clsx';
1313import { useFetch } from '@gitroom/helpers/utils/custom.fetch' ;
1414import { ExistingDataContextProvider } from '@gitroom/frontend/components/launches/helpers/use.existing.data' ;
1515import { useDrag , useDrop } from 'react-dnd' ;
16- import { DNDProvider } from '@gitroom/frontend/components/launches/helpers/dnd.provider' ;
1716import { Integration , Post , State } from '@prisma/client' ;
1817import { useAddProvider } from '@gitroom/frontend/components/launches/add.provider.component' ;
1918import { CommentComponent } from '@gitroom/frontend/components/launches/comments/comment.component' ;
@@ -27,9 +26,19 @@ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
2726import { groupBy , sortBy } from 'lodash' ;
2827import Image from 'next/image' ;
2928import { extend } from 'dayjs' ;
29+ import { isUSCitizen } from './helpers/isuscitizen.utils' ;
30+ import removeMd from 'remove-markdown' ;
3031extend ( isSameOrAfter ) ;
3132extend ( isSameOrBefore ) ;
3233
34+ const convertTimeFormatBasedOnLocality = ( time : number ) => {
35+ if ( isUSCitizen ( ) ) {
36+ return `${ time === 12 ? 12 : time % 12 } :00 ${ time >= 12 ? 'PM' : 'AM' } ` ;
37+ } else {
38+ return `${ time } :00` ;
39+ }
40+ } ;
41+
3342export const days = [
3443 'Monday' ,
3544 'Tuesday' ,
@@ -91,7 +100,7 @@ export const DayView = () => {
91100 . startOf ( 'day' )
92101 . add ( option [ 0 ] . time , 'minute' )
93102 . local ( )
94- . format ( 'HH:mm' ) }
103+ . format ( isUSCitizen ( ) ? 'hh:mm A' : 'HH:mm' ) }
95104 </ div >
96105 < div
97106 key = { option [ 0 ] . time }
@@ -140,7 +149,8 @@ export const WeekView = () => {
140149 { hours . map ( ( hour ) => (
141150 < Fragment key = { hour } >
142151 < div className = "p-2 pr-4 bg-secondary text-center items-center justify-center flex" >
143- { hour . toString ( ) . padStart ( 2 , '0' ) } :00
152+ { /* {hour.toString().padStart(2, '0')}:00 */ }
153+ { convertTimeFormatBasedOnLocality ( hour ) }
144154 </ div >
145155 { days . map ( ( day , indexDay ) => (
146156 < Fragment key = { `${ day } -${ hour } ` } >
@@ -231,15 +241,15 @@ export const Calendar = () => {
231241 const { display } = useCalendar ( ) ;
232242
233243 return (
234- < DNDProvider >
244+ < >
235245 { display === 'day' ? (
236246 < DayView />
237247 ) : display === 'week' ? (
238248 < WeekView />
239249 ) : (
240250 < MonthView />
241251 ) }
242- </ DNDProvider >
252+ </ >
243253 ) ;
244254} ;
245255
@@ -433,8 +443,9 @@ export const CalendarColumn: FC<{
433443 ) }
434444 < div
435445 className = { clsx (
436- 'relative flex flex-col flex-1' ,
437- canDrop && 'bg-white/80'
446+ 'relative flex flex-col flex-1 text-white' ,
447+ canDrop && 'bg-white/80' ,
448+ isBeforeNow && postList . length === 0 && 'cursor-not-allowed'
438449 ) }
439450 >
440451 < div
@@ -445,8 +456,9 @@ export const CalendarColumn: FC<{
445456 }
446457 : { } ) }
447458 className = { clsx (
448- 'flex-col text-[12px] pointer w-full cursor-pointer overflow-hidden overflow-x-auto flex scrollbar scrollbar-thumb-tableBorder scrollbar-track-secondary' ,
449- isBeforeNow && 'bg-customColor23 flex-1' ,
459+ 'flex-col text-[12px] pointer w-full overflow-hidden overflow-x-auto flex scrollbar scrollbar-thumb-tableBorder scrollbar-track-secondary' ,
460+ isBeforeNow ? 'bg-customColor23 flex-1' : 'cursor-pointer' ,
461+ isBeforeNow && postList . length === 0 && 'col-calendar' ,
450462 canBeTrending && 'bg-customColor24'
451463 ) }
452464 >
@@ -593,7 +605,7 @@ const CalendarItem: FC<{
593605 </ div >
594606 < div className = "whitespace-pre-wrap line-clamp-3" >
595607 { state === 'DRAFT' ? 'Draft: ' : '' }
596- { post . content }
608+ { removeMd ( post . content ) . replace ( / \n / g , ' ' ) }
597609 </ div >
598610 </ div >
599611 ) ;
0 commit comments