Code review comment for lp:~nik90/ubuntu-clock-app/correct-time-locale

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> > > 1. Currently the time does not show in the 12 hour locale. Please make the
> > > following change:
> > >
> > > bzr diff
> > > === modified file 'app/clock/Clock.qml'
> > > --- app/clock/Clock.qml 2014-06-30 13:39:47 +0000
> > > +++ app/clock/Clock.qml 2014-06-30 22:42:42 +0000
> > > @@ -95,11 +95,11 @@
> > > }
> > > else if(time.search(Qt.locale().amText) !== -1) {
> > > // 12 hour format detected with the localised AM text
> > > - return time.split(Qt.locale().amText)[0].slice(end-1)
> > > + return time.split(Qt.locale().amText)[0]
> > > }
> > > else {
> > > // 12 hour format detected with the localised PM text
> > > - return time.split(Qt.locale().pmText)[0].slice(end-1)
> > > + return time.split(Qt.locale().pmText)[0]
> > > }
> > > }
> > > }
> >
> > Are you sure? The slice(end-1) is only there to remove the gap between
> "01:00"
> > and "AM" in the string "01:00 AM" which causes the text to be off centered.
> So
> > after splitting it and taking [0], the string is "01:00 " with a space at
> the
> > end which I then slice of.
>
> Positive. "end" is not defined:
>
> file:///home/victor/Development/correct-time-locale/app/clock/Clock.qml:93:
> ReferenceError: end is not defined
>
> Could you simply do this to trim the whitespace:
>

Wasn't aware of the trim() function. Thnx. I did that in the latest rev

« Back to merge proposal